How do I use Schema.org to identify filters on our hotel search site?

时间:2016-05-17 11:16:03

标签: html5 filtering schema.org microdata

I'm working on a site designed to help a user find a hotel. We've got lots of widgets for filtering the hotels we show (e.g. price filters) or else ordering the hotels we show (e.g. by distance).

I can see how to markup our hotels as being a list. And also how to communicate the sort order of the list.

And we're already marking up the hotel's themselves:

<div itemscope itemtype="http://schema.org/Hotel">
    <div itemprop="image" style="background-image: url('{{{ imageUrl }}}');"></div>
    <h2 class="title" itemprop="name">{{ name }}</h2>
    <div itemscope itemtype="http://schema.org/Offer">
        <div itemprop="price">{{{ price }}}</div>
    </div>
</div>

Is there a way of identifying our filters as being tools for adjusting the list?

To get an idea of how the website works see - http://mapov.com/hotels/the+strip/.

2 个答案:

答案 0 :(得分:2)

  

有没有办法将我们的过滤器识别为调整列表的工具?

使用Action类型。

请参阅SearchActionFindActionDiscoverAction)。

Action可用于表示发生的事情(例如,&#34;用户3在阿姆斯特丹搜索酒店&#34;),但也代表潜在行动:使用potentialAction属性指定项目可能具有的操作。

<section itemscope itemtype="http://schema.org/ItemList">
  <div itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
    …
  </div>
</section>

关于您的标记的附注

  • 您的image属性不起作用,它不能将style属性中指定的图像作为值。您必须在&#34;链接&#34;上提供image属性。元素(例如imgalink,...)。

  • 您的OfferHotel无关。您可以使用makesOffer属性。

答案 1 :(得分:0)

<div itemscope itemtype="http://schema.org/Hotel">
 <img itemprop="image" src="http://yourhostel.es/content/124"/>
 <meta itemprop="address" content="you street"/>
<h2 class="title" itemprop="name">name </h2>
<div itemprop="priceRange">price</div><div itemprop="telephone">9999999</div>

价格