Usman Ahmed Posted February 20, 2011 Share Posted February 20, 2011 How can I define search Result Page Title. It is shows empty.For instance following search result page doesn't have any title, just my website name.http://www.shoponbrowse.com/pakistan/search.php?tag=FM+Radio+MobilesI want to add title according to search query. In this case it is "FM Radio Mobiles". Link to comment Share on other sites More sharing options...
marcis Posted September 10, 2013 Share Posted September 10, 2013 You can set a fixed title from "Preferences > SEO", but not the query itself Link to comment Share on other sites More sharing options...
vekia Posted September 10, 2013 Share Posted September 10, 2013 open header.tpl file located in your theme directory change simple <title> tag there to: <title>{$meta_title|escape:'htmlall':'UTF-8'} {if isset($smarty.get.search_query)}{$smarty.get.search_query}{/if}</title> 1 Link to comment Share on other sites More sharing options...
marcis Posted September 11, 2013 Share Posted September 11, 2013 Yes, but that code will show "Search - NAME OF YOUR SITE query" (and the query parameter should be escaped) Link to comment Share on other sites More sharing options...
DannetStudio Posted August 13, 2014 Share Posted August 13, 2014 You can define in header.tpl some like this: {if $page_name == 'search'} <title>Search {if isset($search_query) && $search_query}{$search_query|escape:'html':'UTF-8'}{elseif $search_tag}{$search_tag|escape:'html':'UTF-8'}{elseif $ref}{$ref|escape:'html':'UTF-8'}{/if} {if isset($smarty.get.p)}Page {$smarty.get.p} - {/if}{$meta_title|escape:'html':'UTF-8'}</title> {else} <title>{$meta_title|escape:'html':'UTF-8'}</title> {/if} It will show in the search results page, the input query or tag, and also add pagination to avoid duplicated titles. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now