Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Changing Default Search Options
Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Apr 21, 2015 - 6:49 pm

I am wondering if I can change the default search options so that people can search for post and title automatically without having to go into the advanced options?

Thank you!

Avatar
kvr28
Member
Free Members
sp_UserOfflineSmall Offline
Apr 21, 2015 - 7:17 pm

I was just about to make the same thread, I prefer if my members can only search topic titles, any way to move the options to the admin area and let us choose instead of the members?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 21, 2015 - 10:07 pm

@jmwalker yes, you can customize the default setup...  look at your search form template tag in the spHead.php template file of your sp theme...

more info:  https://simple-press.com/docum.....earchform/

you just need to configure it how you want...  as that page shows, most of the search option arguments will be at the top of the spHead.php template file...

@kvr28 no way to move it to options... but you could just configure the defaults the way you want and then just remove the advanced search form if you wanted...

Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Apr 24, 2015 - 2:36 pm

Sorry, I am a bit confused.  I found this template file in my theme but there is nothing regaring the search form template tag.  

I looked at the link that you gave me but I am not much of a coder so I am not sure what I would adjust in this template file to get the desired outcome.  

I am so want to remove the members button on the header of my forum, so that members can't look at other members profile.  Would I edit this same file to do that, or is that a separate question?

Sorry for my ignorance!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 24, 2015 - 2:52 pm

so in your spHead.php template file, as per the codex page, you should see something like:

    $searchForm = array(
        'tagClass'                => 'spLeft spSearchForm',
        'icon'                    => 'sp_Search.png',
        'inputClass'            => 'spControl',
        'inputWidth'            => 20,
        'submitClass'            => 'spButton spRight',
        'advSearchLinkClass'    => 'spLink',
        'advSearchLink'            => '',
        'advSearchId'            => 'spSearchFormAdvanced',
        'advSearchClass'        => 'spSearchFormAdvanced',
        'submitLabel'           => __sp('Search'),
        'advancedLabel'         => __sp('Advanced Search'),
        'lastSearchLabel'        => __sp('Last Search Results'),
        'toolTip'               => __sp('Search the forums'),
        'labelLegend'           => __sp('Advanced Search'),
        'labelScope'            => __sp('Forum Scope'),
        'labelCurrent'          => __sp('Current forum'),
        'labelAll'              => __sp('All forums'),
        'labelMatch'            => __sp('Match'),
        'labelMatchAny'         => __sp('Match any word'),
        'labelMatchAll'         => __sp('Match all words'),
        'labelMatchPhrase'      => __sp('Match phrase'),
        'labelOptions'          => __sp('Forum Options'),
        'labelPostTitles'       => __sp('Posts and topic titles'),
        'labelPostsOnly'        => __sp('Posts only'),
        'labelTitlesOnly'       => __sp('Topic titles only'),
        'labelMinLength'        => __sp('Minimum search word length is %1$s characters - maximum search word length is %2$s characters'),
        'labelMemberSearch'     => __sp('Member Search (Current or All Forums)'),
        'labelTopicsPosted'     => __sp('List Topics You Have Posted To'),
        'labelTopicsStarted'    => __sp('List Topics You Started'),
        'searchIncludeDef'        => 1,  # 1 = content, 2 = titles, 3 = content and title (warning #3 is a resource hog)
        'searchScope'                => 1,  # 1 = Current Forum, 2 = All Forums
    );

this is from default theme...  per that codex page, you can change the default options to what you want..  ie change searchIncludeDef to be 3 instead of the 1...

as always, we strongly recommend you do this via a child theme or your own custom theme to keep from losing changes on updates...

Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Apr 24, 2015 - 3:06 pm

So this is what the sphead.php looks like when I open it.  I am not using a child-theme or custom theme but I am reading your codex on how to set that up. 

Image Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 24, 2015 - 3:09 pm

that is why I said it was for default theme..  you are using reboot...  so slightly different...

the image you uploaded shows a file getting included..  you need that file...  reboot/templates/desktop/spHeadDesktop.php

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 24, 2015 - 3:09 pm

and you may also want to change it on mobile/spHeadMobile.php

Avatar
Jenn Walker
Member
Free Members
sp_UserOfflineSmall Offline
Apr 25, 2015 - 12:10 am

So I am going through your instructions to set up a child theme of the Reboot theme.  

You mention:

the image you uploaded shows a file getting included..  you need that file…  reboot/templates/desktop/spHeadDesktop.php

I am using the child theme and have copied this spHeadDesktop.php to the child theme but it is still not showing up.  

This file is also in the reboot theme folder, but never showed up as an option to edit. 

 

Image Enlarger

 

If I understand the instructions correctly I need to change the information in this file for my child theme so I have renamed the Theme in this file mySiteRebootChild. 

 

Image Enlarger

 

The problem is that I still get the same message about needing to edit the spHeadDesktop.php file but that isn't an available template file.  when I try to edit my template as before:

 

Image Enlarger

 

Does that make sense? 

Obviously I am missing something and I have read and reread the child theme instructions in the codex. If you can guide me that would be great.  

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 25, 2015 - 1:15 am

can you explain what you did a bit more?  did you start with our reboot-child theme?   so that you have a spHead.php template file in the templates folder?

or did you just your child from scratch?  in which case you would manually need to add the spHead.php template file...

its the one that calls the file you modified... so if not in your child, it would be including the parent...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625