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

痴心易碎 提交于 2019-12-08 06:13:30

问题


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/.


回答1:


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

With an Action type.

See SearchAction or perhaps FindAction (DiscoverAction).

An Action can be used to represent what happened (e.g., "User 3 searched for hotels in Amsterdam"), but also for representing potential actions: use the potentialAction property to specify the possible actions an item can have.

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

Side notes about your markup

  • Your image property won’t work, it can’t have an image specified in the style attribute as value. You have to provide the image property on a "link" element (e.g., img, a, link, …).

  • Your Offer is not associated with the Hotel. You could use the makesOffer property.




回答2:


<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>

price



来源:https://stackoverflow.com/questions/37274557/how-do-i-use-schema-org-to-identify-filters-on-our-hotel-search-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!