outeredge/magento-structured-data-module

outer/edge出品的Magento结构化数据模块

安装数: 57,844

依赖项: 0

建议者: 0

安全性: 0

星级: 51

关注者: 11

分支: 14

开放问题: 7

类型:magento2-module


README

Packagist Packagist Packagist

outer/edge为Magento 2提供的结构化数据模块

HyväBreeze 兼容。

我们的开源模块允许您通过安装我们的模块并设置一些配置选项,快速将结构化数据标记(也称为丰富片段)添加到任何Magento 2店铺。

安装此模块后,您的产品、联系和CMS页面将包含有效的结构化数据。例如: https://developers.google.com/search/docs/advanced/structured-data/product

它将类似于以下内容

<script type="application/ld+json">
{
    "@context": "https://schema.org/",
    "@type": "Product",
    "@id": "https://example.co.uk/blue-t-shirt#Product",
    "brand": {
            "@type": "Brand",
            "name": "Nike"
    },
    "aggregateRating": {
        "@type": "AggregateRating",
        "bestRating": "100",
        "worstRating": "1",
        "ratingValue": "4.55",
        "reviewCount": "5"
    },
    "name": "Nike Blue T-Shirt",
    "sku": "blue-t-shirt",
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer viverra vitae nulla quis venenatis. Donec sollicitudin pharetra eros, in facilisis justo fringilla eu. In at consequat felis.",
    "image": "https://example.co.uk/media/catalog/product/b/t/blue-t-shirt.jpg",
    "offers": {
        "@type": "Offer",
        "url": "https://example.co.uk/blue-t-shirt",
        "price": 18.99,
        "priceCurrency": "GBP",
        "priceSpecification": {
            "@type": "UnitPriceSpecification",
            "price": 18.99,
            "priceCurrency": "GBP",
            "valueAddedTaxIncluded": true
        },
        "availability": "http://schema.org/InStock",
        "itemCondition": "http://schema.org/NewCondition"
    }
}
</script>

该模块提供以下结构化数据

产品页面(支持GraphQL)

  • @type
  • @id
  • name
  • sku
  • description
  • image
  • weight
  • brand
  • aggregateRating
    • bestRating
    • worstRating
    • ratingValue
    • reviewCount
  • mpn
  • material
  • color
  • price
  • priceCurency
  • valueAddedTaxIncluded
  • availability
  • itemCondition
  • AggregateOffer
    • offers
  • highPrice
  • lowPrice

联系页面

  • @type
  • @id
  • name
  • image
  • address
  • telephone
  • email
  • url
  • geo

CMS页面

  • name
  • mainContentOfPage
  • description
  • primaryImageOfPage

安装

通过Composer安装

composer require outeredge/magento-structured-data-module

查看结构化数据模块的配置

配置在 商店 > 配置 > outer/edge > 结构化数据 中可用。以下选项可用

结构化数据(产品)

structured_data-product

  • 启用: 启用或禁用产品页面上的结构化数据。
  • 使用简短描述: 使用 short_description 属性作为 description 标记。默认情况下将使用 description
  • 包含子产品: 选择是否在可配置产品页面上包含每个子(简单)产品的单独出价。
  • 包含产品重量: 在产品页面结构化数据中添加 weight 架构。
  • 产品品牌/制造商字段: 选择用于填充结构化数据值的Magento属性。
    • 品牌(默认:manufacturerbrand
    • MPN(默认:空)
    • ISBN(默认:空)
    • 尺寸(默认:空)
    • GTIN(默认:空)
    • 颜色(默认:ColorColour
    • 材料(默认:空)
    • 关键词(默认:空)

结构化数据(CMS页面)

structured_data-cms

  • 启用: 启用或禁用CMS页面上的结构化数据。
  • 启用关于页面: 启用或禁用 "@type": "AboutPage"
  • 关于页面: 选择用于 "@type": "AboutPage" 的CMS页面。

结构化数据(联系页面)

structured_data-contact

  • 启用: 启用或禁用联系页面上的结构化数据。
  • 类型: 选择业务是本地企业还是组织。
  • 纬度: 指定本地企业的纬度。
  • 经度: 指定本地企业的经度。

一旦模块安装和配置完成,您将在源代码中找到结构化数据标记

schema_screenshot

GraphQL

我们的结构化数据模块为内置的Magento GraphGL端点提供了产品结构化数据。只需按照以下示例请求structured_data字段,并按照产品数据提供示例,数据将以JSON数组的形式返回

{
  products(
    filter: {
        ...
    }
  ) {
    items {
      sku
      name
      structured_data
    }
  }
}

卸载模块

通过Composer移除

composer remove outeredge/magento-structured-data-module

参考资料

关于结构化数据格式的Google文档(使用JSON-LD格式)

https://developers.google.com/search/docs/guides/intro-structured-data https://developers.google.com/search/docs/advanced/structured-data/product

结构化数据语法基于

http://schema.org/