FAQ页面的Schema.org [英] Schema.org for the FAQ page

查看:107
本文介绍了FAQ页面的Schema.org的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个常见问题解答"页面,我想用更好的html架构来做到这一点.

I have a FAQ page and I want to do it with better html-schema.

<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结构化数据测试工具中进行验证.

I think a better type for the page is FAQPage instead of WebPage, but FAQPage has pending status and doesn't validate in Google Structured Data Testing Tool.

您对此计划有何看法?正确吗?

What do you think about this scheme? Is it correct?

推荐答案

FAQPage 将是最好的键入页面.如果您不希望在发行前使用它,则WebPage是最好的选择.您也可以考虑同时使用这两种类型,并在FAQPage是核心词汇表的一部分后立即删除WebPage(如果将FAQPage转到

FAQPage will be the best type for the page. If you don’t want to use it until it’s released, WebPage is the best alternative. You could also consider using both types for now, and remove WebPage as soon as FAQPage is part of the core vocabulary (or remove FAQPage if it goes to the attic):

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

我不会使用mainContentOfPage属性.它期望WebPageElement,通常没有用.

I wouldn’t use the mainContentOfPage property. It expects a WebPageElement, which is typically not useful.

在您的情况下,Question项未连接到WebPage项.为此,您可以使用 hasPart属性.

In your case, the Question items aren’t connected to the WebPage item. For this, you could use the 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元素,因为我认为从语义上讲更有意义).

(I switched the article and section elements because I think it makes more sense that way, semantically.)

这篇关于FAQ页面的Schema.org的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆