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/.
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 thestyle
attribute as value. You have to provide theimage
property on a "link" element (e.g.,img
,a
,link
, …).Your
Offer
is not associated with theHotel
. You could use themakesOffer
property.
<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