Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2015
    Posts
    4
    Member #
    52095

    Google's Sitelinks Search Box

    Hello, I'm trying to get google's sitelinks search box working in my site.

    Introductions: https://developers.google.com/struct.../slsb-overview

    I have tested my dev site with this tool:

    https://developers.google.com/struct.../testing-tool/

    and I get two errors:


    "Google does not recognize the attribute type WebSite target destination."

    "Google does not recognize the attribute query-input type WebSite destination."


    I using drupal, but here is my codes:


    script is in <head> section:

    HTML Code:
    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "WebSite",
      "url": "http://www.Mysite.com/",
      "name":"Mysite.com",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "http://www.Mysite.com/search?keyword={search_term_string}&type=article",
        "query-input": "required name=search_term_string"
      }
    }
    </script>
    search from wrapper

    HTML Code:
    <input itemprop="query-input" name="keys" type="text" size="" value="" id="edit-keys" class="form-control search-field-custom" placeholder="<?php echo t('Search'); ?>" required/>
    search form

    HTML Code:
    <div itemscope itemtype="http://schema.org/WebSite">
    <meta itemprop="url" content="http://www.Mysite.com/"/>
    
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction" class=" navbar-form navbar-right" action="<?php echo $base_url . $form['#action'] ?>" method="post" id="search-form" accept-charset="UTF-8">
    
    <meta itemprop="target" content="http://www.Mysite.com/search?keyword={keys}&type=article"/>
    
    <?php print render($form['basic']['keys']);?>
    <?php print drupal_render_children($form); ?>
    
    </form>
    </div>
    When I change <input name="keys"> to something else, my search not working anymore. This is drupal search block and I don't get this working. :/
    Last edited by denman; Jan 29th, 2016 at 11:55 AM.

  2.  

  3. #2
    Junior Member
    Join Date
    Sep 2015
    Posts
    4
    Member #
    52095
    Can anyone help me?

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Your links don't work, and I'm not really sure why you're making it so complex.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Junior Member
    Join Date
    Sep 2015
    Posts
    4
    Member #
    52095
    Can you tell me easy way to do that?

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    To do what? I don't even really understand your question or what you're trying to show us.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 10:53 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com