【发布时间】:2019-02-21 10:10:30
【问题描述】:
我最近开始为一家美容公司工作,该公司希望为其产品页面实施丰富的 sn-ps。我知道 Schema.org 标记是如何工作的,因为我复制了一个通用的 Organization 标记,我的朋友在一家移动应用程序开发公司使用它。
这是我所指的代码模板:
<script type="application/ld+json">
{ "@context": "http://schema.org",
"@type": "Organization",
"name": "Company name",
"legalName" : "Legal Name",
"url": "Company URL",
"logo": "internal logo link",
"foundingDate": "founding date",
"founders": [
{
"@type": "Person",
"name": "Founder"
} ],
"address": {
"@type": "PostalAddress",
"streetAddress": "Street Address",
"addressLocality": "City",
"addressRegion": "Region",
"postalCode": "Postcode",
"addressCountry": "United Kingdom"
},
"contactPoint": {
"@type": "ContactPoint",
"contactType": "customer support",
"telephone": "Phone Number",
"email": "email contact"
},
"sameAs": [
"Social Media Links"
]}
</script>
不幸的是,这家公司的网站基于 Shopify。
在我无休止的研究中,我遇到了许多不同的网站和博客,它们告诉我只需将此 script 添加到 theme.liquid 文件中,但我找不到正确实施它的方法。 This is the blog post I was browsing。
你们中有人有这方面的经验吗,或者我应该联系 Shopify 开发人员并让他来完成这项工作?
我已经尝试过使用这个代码模板(我只是将它复制并粘贴到液体文件中):
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "{{ product.title }}",
"sku": "{{ product.variants.first.sku }}",
"gtin14": "{{ product.variants.first.barcode }}",
"brand": "{{ product.vendor }}",
"description": "{{ product.description | strip_html | escape }}",
"image": "https:{{ product.featured_image.src | img_url: 'grande' }}",
"offers": {
"@type": "Offer",
"priceCurrency": "{{ shop.currency }}",
"price": "{{ product.price |money_without_currency | strip_html }}",
"itemCondition" : "http://schema.org/NewCondition",
"availability" : "{% if product.available == true %}http://schema.org/InStock{% else %}http://schema.org/OutOfStock{% endif %}",
"url" : "{{ shop.url }}{{ product.url }}"
}
}
</script>
【问题讨论】:
标签: shopify schema.org json-ld