Hi,

I just wondering whether we could customise "search" or "advance search".

For instance, I add some fields (such as age, country, ...etc) on the signup forms. After that, other users can perform search base on country, range of the age to find new friends.

In addition, only those who have high position or ranking are able to search as above, while the rest can only perform normal or less detail search.

Are that possible? This is due to I can't find any relevant module about this.
Thanks. I just wish to get some advice from you.

Comments

WorldFallz’s picture

You bet-- there's a number of ways. You can customize the advanced search form directly via hook_form_alter. You can copy the modules/search/*.tpl.php files and customize those. Create your own search form (see http://drupal.org/node/224183). Use the http://drupal.org/project/search_config and/or http://drupal.org/project/custom_search_box modules. Or create a search form with views, exposed filters, and optionally the http://drupal.org/project/views_filter_pack module (for an example of this see any module's issue queue). For searching user profiles, this is probably the easiest method.

DLZJ’s picture

Hi WorldFallz,

Thanks for your advice.

I am not so sure about which method I should use as mentioned above.

Basically, I want to create a job board. I'll need 2 custom search bars.

One is for job seekers. They can choose the types of job that they want (eg, sales, IT support, manager, admin), range of salary (eg USD xxx to USD xxx), location and other criteria.

The other one is for employer. They can choose the type of employees they like based on certain criteria as well, such as qualification, skill, expected salary from job seeker and ...etc.

The search boxes should be assignned based on roles (either to the employer or job seeker).

I will make them to fill out the forms when they sign up but I am not sure whether such custom search is available for us to use.

Could you provide further advice on this issue?

Thank you.

WorldFallz’s picture

Based on this info, I would create 2 different views (with "exposed filters") to act as the custom searches. You can use the "Access" setting of the view to limit it to a specific role so it should be quite easy to get what you're looking for.

DLZJ’s picture

HI, thanks for your advice again.

Do you mean that I shall use Views Filter Pack to get the result I wanted?

WorldFallz’s picture

Depends-- you may not need it. I would try getting what you want without it first and only add it if you need to.

DLZJ’s picture

Hi, were you talking about the existing search module in Drupal or view module?

May I know which module shall I use?

Thanks again.

WorldFallz’s picture

Sorry-- i was speaking of the views_filter_pack module. Build your view with exposed filters first, then add the filter pack if you need to.

xsean’s picture

hi worldfallz,

i have idea how to create view and exposed filter but i have no idea how to theming the exposed filter criteria layout(dropdown, textbox)?

can you some advise for this? maybe you can refer this website.
http://www.h1n1.net.my/view-search?city=&postcode=&state=Wilayah+Perseku...

thanks!

WorldFallz’s picture

pavanthatha’s picture

Hi,
If DLZJ has acheived what ever he/she has set out to do.I am interested in learning in detail how he/she has done it.I am a complete NEWBIE.There is a dearth of tutorials on exactly how to do this.I would also appreciate if any body else also could help me out.

Thanx in advance,