【问题标题】:Schema.org markup for questions & answers inside 'Product'Schema.org 标记“产品”内的问题和答案
【发布时间】:2017-12-11 21:46:44
【问题描述】:

有人可以建议为用户可以购买某些产品的页面添加正确的 Schema.org 标记的最佳方法吗?我在那里添加了Product 标签(用于丰富的片段)。

我想增加询问有关此产品的问题的可能性,但我没有找到可以用作嵌入项目的属性。

例子:

<div itemscope="" itemtype="http://schema.org/Product">
    <meta itemprop="brand" content="Brand">
    <meta itemprop="url" content="URL">
    ......

    <div id="question1" itemprop=??????? itemscope="" itemtype="http://schema.org/Question">
         ......
        <div id="answer1" itemprop=??????? itemscope="" itemtype="http://schema.org/Question/Answer">....</div>
        <div id="answer2" itemprop=??????? itemscope="" itemtype="http://schema.org/Question/Answer">....</div>
    </div>
    ...
    <div id="question10" itemprop=??????? itemscope="" itemtype="http://schema.org/Question">
        ......
        <div id="answer1" itemprop=??????? itemscope="" itemtype="http://schema.org/Question/Answer">....</div>
        <div id="answer2" itemprop=??????? itemscope="" itemtype="http://schema.org/Question/Answer">....</div>
    </div>
</div> 

【问题讨论】:

    标签: product schema.org microdata google-rich-snippets


    【解决方案1】:

    没有属性可以将Question 添加到Product。
    但是有一个属性可以传达Question 大约是Product:about。

    可以通过多种方式使用微数据对其进行标记。以下是使用itemref 的示例:

    <div id="product-42" itemprop="about" itemscope itemtype="http://schema.org/Product">
    </div>
    
    <div itemscope itemtype="http://schema.org/Question" itemref="product-42">
    </div>
    
    <div itemscope itemtype="http://schema.org/Question" itemref="product-42">
    </div>
    

    要将Answer 链接到Question,您可以使用suggestedAnswer/acceptedAnswer。

    【讨论】:

    • 非常感谢!所以没有办法在 Product div 中包含 Questions div 块,因为不幸的是我不允许更改 html 结构很多?
    • @NikaDerkach:有两种方法。 1) 您可以使用itemprop-reverse 属性(不是微数据规范的一部分)在另一个方向上指定about。 2) 您可以使用itemid 为您的产品提供一个URI 作为ID,并使用此URI 作为about 属性的值(例如,在link 元素中)。 -- 对于这两种方式,您都可以在my answer to the question Linking independent elements in Microdata 中找到示例。
    • 非常感谢@unor!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-20
    • 2013-08-04
    相关资源
    最近更新 更多