XF 1.4 How to put search box on search engine result?

clove28

Active member
I've seen this in many sites but I don't know where to put the codes provided by google in xenforo template. Anybody knows where I could put it? I see that xenforo has it.

upload_2015-7-9_15-24-10.png
 

Russ

Well-known member
Starting in... 1.4(? maybe), the page_container was updated with this snippet at the bottom:

Code:
<xen:if is="{$isIndexPage} AND {$canSearch}">
<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "{xen:jsescape {xen:link canonical:index}}",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "{xen:jsescape {xen:link canonical:search/search}}{xen:if $xenOptions.useFriendlyUrls, '?', '&'}keywords={search_keywords}",
     "query-input": "required name=search_keywords"
   }
}
</script>
</xen:if>
I believe that's the related code, after that it just takes a little time.
 

clove28

Active member
Starting in... 1.4(? maybe), the page_container was updated with this snippet at the bottom:

Code:
<xen:if is="{$isIndexPage} AND {$canSearch}">
<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "{xen:jsescape {xen:link canonical:index}}",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "{xen:jsescape {xen:link canonical:search/search}}{xen:if $xenOptions.useFriendlyUrls, '?', '&'}keywords={search_keywords}",
     "query-input": "required name=search_keywords"
   }
}
</script>
</xen:if>
I believe that's the related code, after that it just takes a little time.
Thank you Russ! I'm going to try it now. :)
 

clove28

Active member
Starting in... 1.4(? maybe), the page_container was updated with this snippet at the bottom:

Code:
<xen:if is="{$isIndexPage} AND {$canSearch}">
<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "{xen:jsescape {xen:link canonical:index}}",
   "potentialAction": {
     "@type": "SearchAction",
     "target": "{xen:jsescape {xen:link canonical:search/search}}{xen:if $xenOptions.useFriendlyUrls, '?', '&'}keywords={search_keywords}",
     "query-input": "required name=search_keywords"
   }
}
</script>
</xen:if>
I believe that's the related code, after that it just takes a little time.
Russ, I noticed that the code is already in my PAGE_CONTAINER template. But I didn't put that code. Is it a feature of Modest style?
 

Russ

Well-known member
Aw! I didn't noticed you have replied. Anyway, is it a feature of your modest style?
No like I mentioned, starting in 1.4 they put it inside PAGE_CONTAINER by default, I was just mentioning it so you could double check it's in yours :)
 
Top