【问题标题】:Schema.org for the FAQ page常见问题页面的 Schema.org
【发布时间】:2018-02-02 10:52:24
【问题描述】:

我有一个常见问题页面,我想用更好的 html 模式来做。

<main role="main" itemscope itemtype="http://schema.org/WebPage">
  <article itemprop="mainContentOfPage">
    <header>
      <h1>Frequently Asked Questions</h1>
    </header>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #1</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #1</span>
      </p>
    </section>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #2</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #2</span>
      </p>
    </section>
    <section itemscope itemtype="http://schema.org/Question">
      <h2 itemprop="name">Some question #3</h2>
      <p itemprop="suggestedAnswer acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
        <span itemprop="text">This is an answer #3</span>
      </p>
    </section>
  </article>
</main>

我认为页面的更好类型是FAQPage 而不是WebPage,但FAQPage 处于待处理状态并且不在Google 结构化数据测试工具中验证。

你觉得这个方案怎么样?对吗?

【问题讨论】:

    标签: html schema.org microdata


    【解决方案1】:

    FAQPage 将是页面的最佳类型。如果您不想在它发布之前使用它,WebPage 是最好的选择。您现在也可以考虑同时使用这两种类型,并在 FAQPage 是核心词汇表的一部分时立即删除 WebPage(或者如果它转到 attic,则删除 FAQPage):

    <main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">
    

    我不会使用 mainContentOfPage 属性。它需要一个WebPageElement,这通常没有用。

    在您的情况下,Question 项目未连接到 WebPage 项目。为此,您可以使用hasPart property

    <main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">
    
      <section>
    
        <h2 itemprop="name">Frequently Asked Questions</h2>
    
        <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
        <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
        <article itemprop="hasPart" itemscope itemtype="http://schema.org/Question"></article>
    
      </section>
    
    </main>
    

    (我切换了 articlesection 元素,因为我认为这样在语义上更有意义。)

    【讨论】:

    • 我认为我对article &gt; section 的做法是正确的,因为在我的案例部分中 - 它只是文章的一部分。 developer.mozilla.org/en-US/docs/Web/HTML/Element/article
    • @SergeyEroshenkov:我不同意这是否是一个典型的常见问题解答页面:用户不需要阅读所有问题/答案对才有意义,每个 Q/A 对都独立存在(可以有自己的页面、自己的作者、自己的 cmets、自己的提要条目等)。这两个都可以表明article 适合每一对,而不是整个事情。 -- 但是,如果它不是典型的常见问题解答页面,而是将问题/答案对集成到具有上下文的文章中(因此不仅仅是 Q/A 对的列表),那么整个事情的 article 是合适的。
    • 自 2019 年 5 月 7 日起,FAQPage 现在是官方架构扩展:schema.org/FAQPagedevelopers.google.com/search/docs/data-types/faqpagesearchengineland.com/…
    猜你喜欢
    • 2017-04-28
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 2018-07-09
    • 1970-01-01
    • 2011-05-07
    相关资源
    最近更新 更多