有没有办法在餐馆菜单中描述每道菜的特性?
这些字段特别是:名称,描述,价格
或者当你在餐馆物业中指出菜单的网址时,是否必须祈祷谷歌解释数据是正确的?
答案 0 :(得分:2)
有几种选择,取决于(某种程度上)个人偏好:
保留并查看Google是否理解
menu将值定义为Text或URL,因此提供其中任何一个都应该足够了。做其他事可能会混淆Google或其他解析器,因为不遵守规范。
Here's an article which shows a URL providing a menu to Google without any schema,系统 工作。
在网址目的地提供架构
ItemList是最通用的列表类型,允许您将itemListElement添加到列表中。这并未指定列表是菜单,但提供URL的菜单属性应该足够。
或者,Offer允许您指定满足您要求的名称,描述和价格。 Product不允许您指定价格,因此此处优惠。由于itemListElement可以是Thing,因此您可以在ItemList中组合Offers。
答案 1 :(得分:2)
词汇表Schema.org(尚未)提供用于表示餐馆菜单或单个菜单项的类型。
他们的menu
property期望文本或网址为值。如果应该有一个菜单类型,它将成为另一个预期值。
问题Extension Proposal: FoodProduct and Restaurant Menu with FoodProducts.要求这样做。它已关闭,引用了更广泛的问题Create a new Food type (help further with foodWarning and recipeIngredient)。它仍在讨论中。
如果您需要 now ,可以使用引用hasOfferCatalog
property的OfferCatalog
type(代表菜单或菜单的分组部分)和{{3 (代表单个菜单项,有价格)。
例如:
<div vocab="http://schema.org/" typeof="Restaurant">
<section property="hasOfferCatalog" typeof="OfferCatalog">
<h1 property="name">Menu</h1>
<ul>
<li property="itemListElement" typeof="Offer">
<b property="name">Bread</b> –
<span property="price">1.50</span>
<meta property="priceCurrency" content="EUR" />
</li>
<li property="itemListElement" typeof="Offer">
<b property="name">Water</b> –
<span property="price">1.00</span>
<meta property="priceCurrency" content="EUR" />
</li>
</ul>
</section>
</div>
如果您也想使用menu
属性,则可以添加一个div
,其中包含OfferCatalog
。 menu
的值将是文本内容。
<div vocab="http://schema.org/" typeof="Restaurant">
<div property="menu">
<section property="hasOfferCatalog" typeof="OfferCatalog">
<!-- … -->
</section>
</div>
</div>
答案 2 :(得分:0)
这真是个好消息!所以,在这里,我要分享一些我一直在等待的时间。
如果你一直在梦想一个适当的方法,允许多个餐厅菜单标记菜单部分甚至提供差异化,你会惊讶于刷新的schema.org/restaurant结构标记的可能性。
当您访问schema.org/Restaurant页面时,您会注意到的第一件事是菜单属性已替换为 hasMenu 属性,该属性现已取代仍然有效的菜单一个。
所以,直截了当:
在网站的每个页面上,建议将搜索引擎指向正确的方向,以确定菜单的位置。这是nice article,涵盖了我在这里汇总的大部分内容。
Google的指南指出,我们只应标记页面上显示的内容,除非整个菜单在那里发布,否则我们无法将整个菜单完全包含在主页标记中。相反,我们只需使用主页上的 hasMenu 属性指向菜单页面,如下所示:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "Your Restaurant's Name",
"url": "http://your-restaurant.com/",
"publisher": {
"@type": "Restaurant",
"name": "Your Restaurant's Name",
"hasMenu": "http://your-restaurant.com/menu/",
"logo": "http://.....
事实上,在您网站的任何包含某些架构标记的页面上,您可以使用hasMenu属性指向菜单页面的URL。
如果您有多个菜单:
“hasMenu”: [
{
“@type”: “Menu”,
“name”: “Breakfast”,
“url”: “http://your-restaurant.com/breakfast-menu/”
},
{
“@type”: “Menu”,
“name”: “Lunch”,
“url”: “http://your-restaurant.com/lunch-menu/”
},
{
“@type”: “Menu”,
“name”: “Dinner”,
“url”: “http://your-restaurant.com/dinner-menu/”
}
],
...
将注意力转移到实际菜单页面,假设菜单仅在下午5:00到晚上11:00之间提供。因此,在菜单页面上,我们的标记将如下所示:
<script type=”application/ld+json”>
{
“@context”: “http://schema.org”,
“@type”: “Menu”,
“name”: “Our Menu”,
“mainEntityOfPage”: “http://your-restaurant.com/menu/”,
“inLanguage”: “English”,
“offers”: {
“@type”: “Offer”,
“availabilityStarts”: “T17:00”,
“availabilityEnds”: “T23:00”
},
接下来,我们可以开始标记菜单的各个部分和各个菜单项。首先,我们将从开胃菜开始。对于第一个开胃菜,我们将在标记中包含名称,简要说明和价格,这应该是任何菜单项的最小值。在我们的第二个开胃菜标记示例中,我们还将包括图像,营养信息以及无麸质这一事实:
“hasMenuSection”: [
{
“@type”: “MenuSection”,
“name”: “Appetizers”,
“hasMenuItem”: [
{
“@type”: “MenuItem”,
“name”: “Fried Eggplant”,
“description”: “Served with Italian red gravy.”,
“offers”: {
“@type”: “Offer”,
“price”: “7.95”,
“priceCurrency”: “USD”
}
},
{
“@type”: “MenuItem”,
“name”: “Fried Calamari”,
“description”: “Served with Italian red gravy or honey mustard.”,
“image”: “http://your-restaurant.com/images/fried-calamari.jpg”,
“suitableForDiet”: “http://schema.org/GlutenFreeDiet”,
“nutrition”: {
“@type”: “NutritionInformation”,
“calories”: “573 calories”,
“fatContent”: “25 grams”,
“carbohydrateContent”: “26 grams”,
“proteinContent”: “61 grams”
},
“offers”: {
“@type”: “Offer”,
“price”: “7.95”,
“priceCurrency”: “USD”
}
}
]
},
假设我们已经标记了所有的开胃菜,我们已准备好开始标记下一个菜单部分,在我们的例子中是汤。有时,诸如汤之类的菜单项有两种或更多种尺寸可供选择。我们可以使用单独的商品标记以及qualifiedQuantity属性来标记可用选项,如下所示:
{
“@type”: “MenuSection”,
“name”: “Soups”,
“hasMenuItem”: [
{
“@type”: “MenuItem”,
“name”: “Lobster Bisque”,
“offers”: [
{
“@type”: “Offer”,
“price”: “6.75”,
“priceCurrency”: “USD”,
“eligibleQuantity”: {
“@type”: “QuantitativeValue”,
“name”: “Cup”
}
},
{
“@type”: “Offer”,
“price”: “9.95”,
“priceCurrency”: “USD”,
“eligibleQuantity” : {
“@type”: “QuantitativeValue”,
“name”: “Bowl”
}
}
]
},
{
“@type”: “MenuItem”,
“name”: “Creole Seafood Gumbo”,
“offers”: [
{
“@type”: “Offer”,
“price”: “6.75”,
“priceCurrency”: “USD”,
“eligibleQuantity”: {
“@type”: “QuantitativeValue”,
“name”: “Cup”
}
},
{
“@type”: “Offer”,
“name”: “Bowl”,
“price”: “9.95”,
“priceCurrency”: “USD”,
“eligibleQuantity” : {
“@type”: “QuantitativeValue”,
“name”: “Bowl”
}
}
]
}
]
},
在我们标记了所有汤品之后,我们可以继续使用相同的格式标记其他菜单部分和项目。就是这样。总而言之,我们的JSON-LD菜单标记看起来像这样:
<script type=”application/ld+json”>
{
“@context”:”http://schema.org”,
“@type”:”Menu”,
“name”: “Our Menu”,
“url”: “http://your-restaurant.com/menu/”,
“mainEntityOfPage”: “http://your-restaurant.com/menu/”,
“inLanguage”:”English”,
“offers”: {
“@type”: “Offer”,
“availabilityStarts”: “T17:00”,
“availabilityEnds”: “T23:00”
},
“hasMenuSection”: [
{
“@type”: “MenuSection”,
“name”: “Appetizers”,
“hasMenuItem”: [
{
“@type”: “MenuItem”,
“name”: “Fried Eggplant”,
“description”: “Served with Italian red gravy.”,
“offers”: {
“@type”: “Offer”,
“price”: “7.95”,
“priceCurrency”: “USD”
}
},
{
“@type”: “MenuItem”,
“name”: “Fried Calamari”,
“description”: “Served with Italian red gravy or honey mustard.”,
“image”: “http://your-restaurant.com/images/fried-calamari.jpg”,
“suitableForDiet”: “http://schema.org/GlutenFreeDiet”,
“nutrition”: {
“@type”: “NutritionInformation”,
“calories”: “573 calories”,
“fatContent”: “25 grams”,
“carbohydrateContent”: “26 grams”,
“proteinContent”: “61 grams”
},
“offers”: {
“@type”: “Offer”,
“price”: “7.95”,
“priceCurrency”: “USD”
}
}
]
},
{
“@type”: “MenuSection”,
“name”: “Soups”,
“hasMenuItem”: [
{
“@type”: “MenuItem”,
“name”: “Lobster Bisque”,
“offers”: [
{
“@type”: “Offer”,
“price”: “6.75”,
“priceCurrency”: “USD”,
“eligibleQuantity”: {
“@type”: “QuantitativeValue”,
“name”: “Cup”
}
},
{
“@type”: “Offer”,
“price”: “9.95”,
“priceCurrency”: “USD”,
“eligibleQuantity” : {
“@type”: “QuantitativeValue”,
“name”: “Bowl”
}
}
]
},
{
“@type”: “MenuItem”,
“name”: “Creole Seafood Gumbo”,
“offers”: [
{
“@type”: “Offer”,
“price”: “6.75”,
“priceCurrency”: “USD”,
“eligibleQuantity”: {
“@type”: “QuantitativeValue”,
“name”: “Cup”
}
},
{
“@type”: “Offer”,
“name”: “Bowl”,
“price”: “9.95”,
“priceCurrency”: “USD”,
“eligibleQuantity” : {
“@type”: “QuantitativeValue”,
“name”: “Bowl”
}
}
]
}
]
},
{
“@type”: “MenuSection”,
“name”: “Pastas”,
“description”: “Entrées served with dinner salad or a cup of soup of the day.”,
“hasMenuItem”: [
{
“@type”: “MenuItem”,
“name”: “Veal Parmigiana”,
“description”: “Tender cuts of paneed veal crowned with golden fried eggplant, Italian red gravy, mozzarella, and parmesan; served with spaghetti.”,
“offers”: {
“@type”: “Offer”,
“price”: “17.95”,
“priceCurrency”: “USD”
}
},
{
“@type”: “MenuItem”,
“name”: “Eggplant Parmigiana”,
“description”: “Pan fried eggplant layered and topped with Italian red gravy, mozzarella, and parmesan baked until bubbly; served with spaghetti.”,
“offers”: {
“@type”: “Offer”,
“price”: “14.95”,
“priceCurrency”: “USD”
}
}
]
}
]
}
</script>
我意识到并非每个餐厅菜单场景都完全覆盖了这些新的菜单属性和类型,但希望您现在至少有足够的开始使用。请记住,Schema.org词汇表也在不断发展,这个特定的架构领域也将如此发展。欢迎您通过Github的讨论参与Schema.org的演变。如果您认为自己有很好的建议,请随时加入对话。