Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Advanced search - change default criterion

11 years 4 months ago
  • Scott's Avatar
    Topic Author
  • Scott
  • Offline
  • Fresh Boarder
  • Posts: 30
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Active

ISSUE SUMMARY:
I'm trying to accomplish two things.

First off, I'd like two search criterion options to display by default for advanced search. Name, and a Profession (a custom field).

If that can't be done, I'd like Profession to be the default search criterion, and then they can choose name if they want when they click add criterion.

In a perfect world, both criterion options would be displayed and they can add criterion to their liking.

Would you help us with this?

Thanks! We love JS.

11 years 4 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Scott,

You should modify / override this file components/com_community/templates/jomsocial/search.advancedsearch.php, find this code :

if($field->fieldcode == 'username')
                                                {
                                                    $selected = "SELECTED";
                                                }

replace to :
if($field->fieldcode == 'FIELD_PROFESSION')
                                                {
                                                    $selected = "SELECTED";
                                                }

i hope it will help

11 years 4 months ago
  • Scott's Avatar
    Topic Author
  • Scott
  • Offline
  • Fresh Boarder
  • Posts: 30
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Active

Should this be done with the same process as customizing the template, described here: documentation.jomsocial.com/wiki/Customizing_Template
It doesn't seem to take unless I override the original file.

Also, is there a way to have more than one criterion show up by default? Ideally, we'd like city, state, and name to be there as well.

11 years 4 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

hi Scott,

Yeah, for override please follow this doc documentation.jomsocial.com/wiki/Customizing_Template

You can change to another custom field, but make sure you set the correct FIELD_ID, in my solution that field type for profession is "FIELD_PROFESSION", so if you wanna change to city, you can use "FIELD_CITY" as example.

thank you

11 years 4 months ago
  • Scott's Avatar
    Topic Author
  • Scott
  • Offline
  • Fresh Boarder
  • Posts: 30
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Active

Yes, but by default I would like there to be multiple search criterion instead of one. So this way, it will have these selections when you first click advanced search instead of having to click add criterion.

profession --- contains --- __________
name --- contains --- __________
city --- contains --- ________
state --- contains --- _________
add criterion

BTW, the customizing template solution is no longer working for me. I followed the instructions and even though /templates/socialize/html doesn't contain the folder com_community, I went ahead and created com_community/jomsocial/layouts per the guide. But that's not working. What am I doing wrong? I'm on jomsocial 4.06 and joomla 3.4.1

11 years 4 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Scott,

I am sorry for many criteria this is not possible, we only provide the 1 criteria for default.

Please you create this override file templates/socialize/html/com_community/search.advancedsearch.php

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW