1

我们希望在我们的网站中实施新的 Google 附加链接搜索框丰富片段 ( https://developers.google.com/webmasters/richsnippets/sitelinkssearch ),该网站使用 Google 自定义搜索引擎。

<div id="cse-search-form">
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction" id="cse-search-box" action="/suche/q.php">
        <meta itemprop="target" content="http://www.example.com/suche/q.php?cx=017002835581306790937%3A802l7atpqxs&ie=UTF-8&q={q]&sa=Suchen"/>
        <input type="hidden" value="017002835581306790937:802l7atpqxs" name="cx">
        <input type="hidden" value="UTF-8" name="ie">
        <input itemprop="query-input" id="googleSearchField" type="text" size="31" name="q" style="background: url("https://www.google.com/cse/images/google_custom_search_watermark.gif") no-repeat scroll 50% 50% transparent;">
        <input class="btn" type="submit" value="Suchen" name="sa">
    </form>
</div>

大家觉得这样行吗?

4

1 回答 1

1

You are using the potentialAction property without showing us the parent item this property belongs to. A WebSite item would probably make the most sense here (as also documented by Google).

The variable in your target property is {q], but you probably meant {q}.

It’s not clear if Google requires it, but they list the url property in their specification, so you might want to add:

<link itemprop="url" href="http://www.example.com/"> <!-- use the canonical URI of your homepage here -->
于 2014-09-10T14:14:58.113 回答