我们有一个在线购物网站,最近我在商店里为我们的商品实施了一个搜索引擎。我想为我们的SERP实施Google Sitelinks搜索框。
通过使用此标记
<div class="search-wrap">
<form class="search-form" action="https://zadomaigradinata.bg/продукти.php" method="get" itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
<meta itemprop="target" content="https://zadomaigradinata.bg/продукти.php?search-input={search-input}&action=search-items"/>
<input itemprop="query-input" type="text" name="search-input" value="" placeholder="Търсете в Магазина">
<button type="submit" name="action" value="search-items"></button>
</form>
</div>
并且仅标记我网站的主页
<body class="index" itemscope itemtype="http://schema.org/WebSite">
<meta itemprop="url" content="https://zadomaigradinata.bg/"/>
<meta itemprop="name" content="Магазин За Дома И Градината"/>
在阅读了一下这种实现方法之后,我发现target
和url
值必须属于同一个域(就像这里一样)。
我也试过只使用拉丁符号并避免使用西里尔语,但SDTT给了我这个错误:
urlTemplate
https://zadomaigradinata.bg/продукти.php?search-input={search-input}&action=search-items
(您的附加链接搜索框模板中有错误:INVALID_SYNTAX。)
考虑到输入字段的名称与括号{search-input}
中的模板中使用的名称相同,并且链接已经通过将{search-input}
替换为任何其他文本来测试工作,我想不出为什么会发生这种情况的任何其他原因?
SDTT似乎不喜欢你的-
中的{search-input}
。
如果用_
替换它,则不会报告错误:
<meta itemprop="target" content="https://zadomaigradinata.bg/продукти.php?search-input={search_input}&action=search-items"/>
<input itemprop="query-input" type="text" name="search_input" value="" placeholder="Търсете в Магазина">