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

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

Discussion in 'Styling and Customization Questions' started by clove28, Jul 9, 2015.

  1. clove28

    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
     
  2. Russ

    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 likes this.
  3. clove28

    clove28 Active Member

    Thank you Russ! I'm going to try it now. :)
     
  4. Russ

    Russ Well-Known Member

    You may already have it set in there :), just a heads up.
     
  5. clove28

    clove28 Active Member

    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?
     
  6. clove28

    clove28 Active Member

    Aw! I didn't noticed you have replied. Anyway, is it a feature of your modest style?
     
  7. Russ

    Russ Well-Known Member

    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 :)
     
    clove28 likes this.

Share This Page