我想啓用Google Sitelinks搜索框爲網站。問題的關鍵是它的自定義搜索頁面由哈希代碼來實現這樣的JSON-LD數據片段是這樣的:啓用Google Sitelinks搜索框
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name" : "my site",
"alternateName" : "example.com",
"url": "http://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "http://www.example.com/Search/#!/Keyword-{search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
儘管谷歌試圖從這一部分"required name=search_term_string"
提取信息以顯示站點鏈接搜索框,遇到問題:
: http://schema.org/True
valueName: missing and required
我懷疑也許谷歌只是希望搜索查詢字符串,而不是哈希代碼內串,你有什麼建議,除了重定向?
可能重複測試工具](http://stackoverflow.com/questions/30780247/sitelinks-search-box-json-ld-giving-error-on-google-structured-data-testing-tool) – unor