Support Forum
Apologies in advance if there is already a topic about this, but is there a way to set the defaults for advanced search (or regular search)? The default for the advanced search option seems to be 'current forum', 'match any word', and 'posts only'. Is there a way to set the default to be 'current forum','match any word', and 'posts and topic titles'? Generally I'm assuming that people would want to search both, so I'm hoping to set it as a default.
depends.. many, but not all, have filters on them that allow you to customize the default...
for scope, you can use filter 'sph_SearchFormForumScope'...
for matching, you can use filter 'sph_SearchFormMatch'...
do you know how to use wp filters?
Visit Cruise Talk Central and Mr Papa's World
oh,and also... we did add a some args to the search form template function which may help...
see: http://codex.simple-press.com/.....earchform/
you can set the searchIncludeDef argument for options... have been meaning to add the scope and match stuff too, just not there now... have opened a ticket...
for the wp hooks, see: http://codex.wordpress.org/Plugin_API
its a bit harder than I let on too after looking a bit more... you will have to use those filters and then search for the checked form element and uncheck it, then search for the other form element and check it...
unfortunately, I am heading out for a cruise and wont be able to work out the code for you until back.. Maybe Andy can help...
but I will also work to get that ticket included in the next release to make this easier...
Visit Cruise Talk Central and Mr Papa's World
Let's do them one at a time:
Forum Scope:
The default IS 'current forum' as you have asked for. It is only NOT 'current forum' when the current view being displayed is not forum specific - i.e., Group View or members List etc. So that seems to satisfy this one.
Match:
This one is always set to 'Match Any Word'. Put simply it is hard to really use any other default value as the setting here really does depend on the search criteria. But 0 this is the default you eant so again - we are OK with this.
Forum Options:
This can be changed in the termplate. By default we set it to 'Posts Only' because (a) it is the most likely one people will use and (b) The 'Posts and Topic Titles' is more resource hungry and does result in slower performance because it has to do so much more work.
To change this - you need to make a small edit to the spHead.php template within the /templates folder of the Simple:Press theme you are using. At the top of that template you will see the block entitled 'Search FORM - OBJECT DEFINITION'. And at the very bottom of that block is the setting called 'searchIncludeDef' with the various settings that can be used. For 'Posts and Topic Ttitles simply change the 1 to a 3.
As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)
YELLOW
SWORDFISH
|
1 Guest(s)