HTML5标签和公寓列表的微观数据 [英] HTML5 tags and microdata for a list of apartments
问题描述
我应该使用哪些HTML5标签和微数据架构来描述要租用的公寓列表?
which HTML5 tags and microdata schema should I use to describe a list of apartments to rent?
它们具有以下属性:
- 姓名
- 图片
- 唯一编号
- 位置
- 描述
- 价格
- Name
- Image
- Unique number
- Location
- Description
- Price
我的HTML结构目前是这样的:
My HTML structure is currently like this:
<section id="featured">
<h2>Featured appartaments</h2>
<ul>
<li>
<article>
<h3><a href="javascript:void(0);">House #1</a></h3>
<img src="http://placehold.it/250x150/" alt="House #1" />
<p>Ref. 40</p>
<p>My location</p>
<p>My description.</p>
<p>Price: € 500.000,00</p>
</article>
</li>
<li>
<article>
<h3><a href="javascript:void(0);">House #2</a></h3>
<img src="http://placehold.it/250x150/" alt="House #2" />
<p>Ref. 41</p>
<p>My location</p>
<p>My description.</p>
<p>Price: € 500.000,00</p>
</article>
</li>
</ul>
</section>
谢谢!
推荐答案
更新(2016): Schema.org现在有适用于住宿的新类型/属性,包括公寓
类型。请参阅更新我的相关答案。我现在将原来的答案保持不变。
Update (2016): Schema.org now has new types/properties for accommodations, including an Apartment
type. See the update in my related answer. I’ll leave the old answer below unchanged for now.
如果你想使用 Schema.org 词汇:
每个公寓都可以用 产品
(大胆强调我的):
Each apartment could be represented by a Product
(bold emphasis mine):
任何提供的产品或服务。例如:一双鞋;音乐会门票; 汽车租赁;理发;或在线播放电视节目的一集。
Any offered product or service. For example: a pair of shoes; a concert ticket; the rental of a car; a haircut; or an episode of a TV show streamed online.
租用此类公寓的报价可用 优惠
:
The offer to rent such an apartment could be represented by an Offer
:
要求将某些权利转让给某个项目或提供服务 - 例如,出售活动门票的要约,租用DVD的一部电影,通过互联网播放电视节目,修理摩托车或借书。
An offer to transfer some rights to an item or to provide a service—for example, an offer to sell tickets to an event, to rent the DVD of a movie, to stream a TV show over the internet, to repair a motorcycle, or to loan a book.
要从产品
链接到商品
,请使用 提供
属性(分别为 itemOffered
property 。
For linking from the Product
to the Offer
, use the offers
property (resp. the itemOffered
property for the other direction).
也可以使用自己提供
(根本不使用产品
),从你的例子来看,这可能在这里有意义。 (当您对同一套房有不同的优惠时,使用优惠
和 产品
是有意义的即,您可以在产品
中提供公寓的元数据,并为不同的日期使用单独的商品
项目等。) 。
It’s also possible to use Offer
on its own (without using Product
at all), and judging from your example, this might make sense here. (Using Offer
and Product
makes sense when you have different offers for the same apartment, i.e., you can give the metadata for the apartment in the Product
and use separate Offer
items for different dates etc.).
所以使用你的例子,它看起来像:
So using your example, it could look like:
<article itemscope itemtype="http://schema.org/Offer">
<h3 itemprop="name"><a itemprop="url" href="">House #1</a></h3>
<img itemprop="image" src="http://placehold.it/250x150/" alt="House #1" />
<p itemprop="serialNumber">Ref. 40</p>
<p>My location</p>
<p itemprop="description">My description.</p>
<p>Price: € <span itemprop="price">500.000,00</span> <meta itemprop="priceCurrency" content="EUR" /></p>
</article>
没有用于指定所提供公寓地址的财产。 优惠
仅允许提供获取优惠的地址/地点( availableAtOrFrom
)。你可以使用 PostalAddress
类型,但是那里将它链接到 Offer
是不合适的属性,要约与地址之间不存在机器可读的连接。
There is no property for specifying the address of the offered apartment. Offer
only allows for giving the address/place where you can obtain the offer (availableAtOrFrom
). You could just use the PostalAddress
type, but as there is no appropriate property to link it to Offer
, there would be no machine-readable connection between the offer and the address.
此外,你可能想要使用
-
businessFunction
→ BusinessFunction 指定它是关于租赁, -
category
用于指定它是关于公寓的(即住宿
), - 等。
businessFunction
→ BusinessFunction for specifying that it’s about renting,category
for specifying that it’s about an apartment (i.e.,Residence
),- etc.
这篇关于HTML5标签和公寓列表的微观数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!