Schema.org WPHeader 的使用(或如何将结构化数据添加到“英雄”图像
Schema.org usage of WPHeader (or how to add structured data to ‘Hero’ images
这个问题与这个问题相关:
最近我在 HTML5 & Schema.org - Structured Microdata for SEO 上发现了这段代码,以及 Schema.org WPHeader
类型 是一个可以包含标记的 WebPageElement
的声明来自 CreativeWork
以及 Thing
:
<header role="banner" itemscope itemtype="http://schema.org/WPHeader">
<meta itemprop="name" content="A name">
<meta itemprop="description" content="A description text">
<h1 itemprop="headline">A headline text</h1>
<img itemprop="image" src="image.jpg">
</header>
如果 WPHeader
的上述陈述和用法是正确的,我想知道下面的代码在语义网的结构化数据方面是否有意义。我的问题背后的原因是我正在寻找一种解决方案,我可以在其中使用 banner/hero 图像来呈现具有典型 CreativeWork
属性的 Event
(或其他)类型的网页,例如 headine
、creator
等等
<article>
<!-- Banner/hero image section for Event-->
<header class="my_hero_class" role="banner" itemscope itemtype="http://schema.org/WPHeader">
<meta itemprop="name" content="My Event">
<meta itemprop="description" content="Description of My Event">
<meta itemprop="keywords" content="keyword1, keyword2, keyword3">
<h1 itemprop="headline">A headline text</h1>
<p itemprop="alternateHeadline">Another headline text<p>
<p itemprop="creator">Artist name<p>
<img itemprop="image" src="hero_image.jpg">
</header>
<!-- Event section -->
<section class="my_event_class" itemscope itemtype="http://schema.org/Event">
<h2 itemprop="name">Name of My Event</h2>
<p itemprop="description">Description of My Event</p>
<p itemprop="text">Text about My Event</p>
<p itemprop="startDate" content="2016-04-21T20:00">Thu, 04/21/16 8:00 p.m.</p>
<meta itemprop="startDate" content="2016-04-21T20:00">
<img itemprop="image" src="poster.jpg">
</section>
<!-- Event Artist section -->
<section class="my_person_class" itemscope itemtype="http://schema.org/Person">
<h2 itemprop="name">Name of Artist</h2>
<p itemprop="description">Description of of Artist</p>
<p itemprop="text">Text about of Artist</p>
<img itemprop="image" src="artist.jpg">
</section>
</article>
WPHeader
WPHeader
类型用于页面的 header(即 WebPage
)。
如果您向 WPHeader
添加属性,这些属性描述 header (!),而不是页面。
因此,例如,name
可能是 "Header",image
可能是 header 的屏幕截图等。这当然通常没有用在页面上显示,通常不能作为结构化数据提供,因此 my recommendation is not to use them.
WebPage
在我看来,WebPage
类型就是您想要的。它的 name
是页面的名称,它的 description
是页面的描述等
如果页面是关于单个实体的(例如 Event
),那么您可以使用更具体的 ItemPage
type. With the mainEntity
属性,您可以指定该实体的主要实体页。
ItemPage
可能与 Event
共享一些 属性 值(例如,description
可能相同),但也可能存在细微差异(例如,WebPage
的 name
可能还包含网站名称)。
<body itemscope itemtype="http://schema.org/ItemPage">
<!-- properties about the event page -->
<article itemprop="mainEntity" itemscope itemtype="http://schema.org/Event">
<!-- properties about the event -->
</article>
<!-- properties about the event page -->
</body>
这个问题与这个问题相关:
最近我在 HTML5 & Schema.org - Structured Microdata for SEO 上发现了这段代码,以及 Schema.org WPHeader
类型 是一个可以包含标记的 WebPageElement
的声明来自 CreativeWork
以及 Thing
:
<header role="banner" itemscope itemtype="http://schema.org/WPHeader">
<meta itemprop="name" content="A name">
<meta itemprop="description" content="A description text">
<h1 itemprop="headline">A headline text</h1>
<img itemprop="image" src="image.jpg">
</header>
如果 WPHeader
的上述陈述和用法是正确的,我想知道下面的代码在语义网的结构化数据方面是否有意义。我的问题背后的原因是我正在寻找一种解决方案,我可以在其中使用 banner/hero 图像来呈现具有典型 CreativeWork
属性的 Event
(或其他)类型的网页,例如 headine
、creator
等等
<article>
<!-- Banner/hero image section for Event-->
<header class="my_hero_class" role="banner" itemscope itemtype="http://schema.org/WPHeader">
<meta itemprop="name" content="My Event">
<meta itemprop="description" content="Description of My Event">
<meta itemprop="keywords" content="keyword1, keyword2, keyword3">
<h1 itemprop="headline">A headline text</h1>
<p itemprop="alternateHeadline">Another headline text<p>
<p itemprop="creator">Artist name<p>
<img itemprop="image" src="hero_image.jpg">
</header>
<!-- Event section -->
<section class="my_event_class" itemscope itemtype="http://schema.org/Event">
<h2 itemprop="name">Name of My Event</h2>
<p itemprop="description">Description of My Event</p>
<p itemprop="text">Text about My Event</p>
<p itemprop="startDate" content="2016-04-21T20:00">Thu, 04/21/16 8:00 p.m.</p>
<meta itemprop="startDate" content="2016-04-21T20:00">
<img itemprop="image" src="poster.jpg">
</section>
<!-- Event Artist section -->
<section class="my_person_class" itemscope itemtype="http://schema.org/Person">
<h2 itemprop="name">Name of Artist</h2>
<p itemprop="description">Description of of Artist</p>
<p itemprop="text">Text about of Artist</p>
<img itemprop="image" src="artist.jpg">
</section>
</article>
WPHeader
WPHeader
类型用于页面的 header(即 WebPage
)。
如果您向 WPHeader
添加属性,这些属性描述 header (!),而不是页面。
因此,例如,name
可能是 "Header",image
可能是 header 的屏幕截图等。这当然通常没有用在页面上显示,通常不能作为结构化数据提供,因此 my recommendation is not to use them.
WebPage
在我看来,WebPage
类型就是您想要的。它的 name
是页面的名称,它的 description
是页面的描述等
如果页面是关于单个实体的(例如 Event
),那么您可以使用更具体的 ItemPage
type. With the mainEntity
属性,您可以指定该实体的主要实体页。
ItemPage
可能与 Event
共享一些 属性 值(例如,description
可能相同),但也可能存在细微差异(例如,WebPage
的 name
可能还包含网站名称)。
<body itemscope itemtype="http://schema.org/ItemPage">
<!-- properties about the event page -->
<article itemprop="mainEntity" itemscope itemtype="http://schema.org/Event">
<!-- properties about the event -->
</article>
<!-- properties about the event page -->
</body>