[英]Schema.org tags for dynamically created search results?
When adding Schema.org tags to a page, should I include items which are dynamically created - eg a component which only exists on a page after a user has entered a search term? 在将Schema.org标签添加到页面时,我是否应该包含动态创建的项目-例如,在用户输入搜索词后仅存在于页面上的组件?
Or should these tags be reserved solely for static objects that will always be on the page? 还是应该仅将这些标记保留给将始终在页面上的静态对象使用?
Schema.org is used for search engines. Schema.org用于搜索引擎。 So you have to think about which content a search engine has access to.
因此,您必须考虑搜索引擎可以访问哪些内容。
Search engines don't necessarily wait for dynamic content (for example content loaded via Ajax, or after user interaction). 搜索引擎不必等待动态内容(例如,通过Ajax加载的内容,或在用户交互之后的内容)。 So all Schema.org markup added to the page after the initial page load may not have the impact you would like.
因此,在初始页面加载后添加到页面的所有Schema.org标记可能都不会产生您想要的影响。
In your example content is shown after a user enters a search term. 在您的示例中,内容是在用户输入搜索词后显示的。 A search engine would not get to that content, so adding Schema.org there would be of little use.
搜索引擎无法获取该内容,因此添加Schema.org几乎没有用。
Some consumers support JavaScript (so they could make use of the structured data on content that is created on the client-side), some consumers don't support JavaScript (so they can't access that structured data). 一些使用者支持JavaScript(因此他们可以在客户端创建的内容上使用结构化数据),一些使用者不支持JavaScript(因此他们不能访问该结构化数据)。
Consumers could be web services (like search engines), but also user agents and tools (like browser extensions). 消费者可以是Web服务(如搜索引擎),也可以是用户代理和工具(如浏览器扩展)。 As an example, Google supports it only for JSON-LD , but not for Microdata or RDFa.
例如, Google仅支持JSON-LD ,而不支持Microdata或RDFa。
If it's not much work for you, go with it. 如果您的工作量不大,那就去吧。 It can't hurt, but could help.
它不会伤害,但可以有所帮助。 If it's work, you might want to consider which consumers you want to support, and then check their documentation.
如果可行,您可能需要考虑要支持的使用者,然后查看其文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.