[英]Schema.org for the FAQ page
我有一個FAQ頁面,我想用更好的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結構化數據測試工具中驗證。
你怎么看待這個計划? 這是對的嗎?
FAQPage
將是該頁面的最佳類型。 如果你不想在它發布之前使用它,那么WebPage
是最好的選擇。 您現在也可以考慮使用這兩種類型,並在FAQPage
成為核心詞匯表的一部分時立即刪除WebPage
(如果它轉到閣樓 ,則刪除FAQPage
):
<main itemscope itemtype="http://schema.org/WebPage http://schema.org/FAQPage">
我不會使用mainContentOfPage
屬性。 它需要一個WebPageElement
,它通常WebPageElement
。
在您的情況下, Question
項目未連接到WebPage
項目。 為此,您可以使用hasPart
屬性 。
<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>
(我改變了article
和section
元素,因為我認為從語義上說這更有意義。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.