Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file Search Box Placeholder For Different Categories

More
3 years 2 months ago #5534 by MyWorld
Hi there,

I have two different categories.

I am using the search box on category 1 at the moment and it has a placeholder text, eg: "Search For XYZ".

When I enable the search for the Category 2, it's showing the placeholder text as per above.  Is there a way the Category 2 can have its own placeholder text?

Thanks!

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #5535 by syw
Hello!

There is a way to do it if you are using 2 different menu items (= views) for your categories.

It requires you override the search layout 'tcpsearch' twice (doc on overrides: simplifyyourweb.com/documentation/trombi...-information/layouts).

In each menu item, set the parameter 'layout suffix' ('advanced' tab), for instance 'cat1' in the view showing contacts from category 1, 'cat2' in the view showing contacts from category 2.

Your overrides will then have the names:
tcpsearch.cat1.php and tcpsearch.cat2.php

In each override, change the language key COM_TROMBINOSCOPEEXTENDED_SEARCH_TEXT to
COM_TROMBINOSCOPEEXTENDED_SEARCH_CAT1_TEXT and COM_TROMBINOSCOPEEXTENDED_SEARCH_CAT2_TEXT or directly to the text you want to use (if your site in in one language only).

If you use the new keys, you will have to create language overrides for those keys for each language.

Quite a few steps, but that's it!

Olivier.

Please Log in or Create an account to join the conversation.