Modifying Search block default options
Posted
#373
(In Topic #86)

Standard member

I have not managed to find out how to define which search content options are selected as default?
Posted

Site director

There is a way to change the top_search block's defaults, but it's too fiddly to explain reasonably.
I think we should make this better, so I've added it to the tracker:
0002378: Allow configuration of search defaults, outside block options - Composr CMS feature tracker
In the past we were very frugal about adding new config options, but that's no longer an issue with Composr as we've improved our configuration subsystem.
For now though it's easiest to just manually alter the PHP code.
If you look in the sources/hooks/modules/search/*.php files you'll find some have:
Code
$info['default'] = false;
Code
$info['default'] = true;
Then save under sources_custom/hooks/modules/search/
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Posted

Standard member

I tried immediately, and it works

I guess the logic is that php files in sources_custom have priority over files in sources, right?
Posted

Site director


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
1 guest and 0 members have just viewed this.