1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

default search type: "everything" to "threads and posts"

Discussion in 'XenForo Questions and Support' started by wtgw, Feb 7, 2011.

  1. wtgw

    wtgw Member

    Can I change the default search type to "threads and posts" instead of everything? Also to have "Display results as threads" checked by default?
     
    Digital Doctor likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can change the Advanced search link in the search menu by editing this template:

    Admin CP -> Appearance -> Templates -> search_bar

    Replace this:

    Code:
    <a href="{xen:link search}" class="advSearchLink">{xen:phrase advanced_search}...</a>
    
    with this:

    Code:
    <a href="{xen:link search, '', 'type=post'}" class="advSearchLink">{xen:phrase advanced_search}...</a>
    
    Now it will link to the Search Threads and Posts page instead of Search Everything.

    You can enable Display results as threads by default by editing this template:

    Admin CP -> Appearance -> Templates -> search_form_post

    Replace this:

    Code:
    	<dl class="ctrlUnit">
    		<dt></dt>
    		<dd><label for="ctrl_group_discussion"><input type="checkbox" name="group_discussion" id="ctrl_group_discussion" value="1"{xen:checked '{$search.group_discussion}'} /> {xen:phrase display_results_as_threads}</label></dd>
    	</dl>
    
    with this:

    Code:
    	<dl class="ctrlUnit">
    		<dt></dt>
    		<dd><label for="ctrl_group_discussion"><input type="checkbox" name="group_discussion" id="ctrl_group_discussion" value="1" checked="checked" /> {xen:phrase display_results_as_threads}</label></dd>
    	</dl>
    
    Now that box will be checked on the Advanced search page by default.
     
    high1976 and Digital Doctor like this.
  3. Digital Doctor

    Digital Doctor Well-Known Member

    + Core
    Until there are other content types ... xenforo.com should default to Advanced Threads and Posts searching.
     

Share This Page