taurus-media / module-structured-data-category
Magento 2 module to add CollectionPage structured data to category pages
Package info
github.com/taurus-media/module-structured-data-category
Type:magento2-module
pkg:composer/taurus-media/module-structured-data-category
1.0.0
2026-10-26 07:20 UTC
Requires
- magento/framework: *
- magento/module-catalog: *
- magento/module-store: *
- magento/module-theme: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-26 07:33:41 UTC
README
Adds CollectionPage structured data (JSON-LD) to category pages.
Features
- Outputs a
CollectionPageJSON-LD block oncatalog_category_view. - Includes publisher (
Organizationwith store logo),BreadcrumbListand anItemListof products on the current page. - Breadcrumbs are taken from the
breadcrumbslayout block, products from thecategory.products.listlayout block. The markup always matches what's visible on the page (pagination, filters, sorting). - Optional
Offerelement per product (price, currency, availability, condition). - Optional
OfferShippingDetailswith configurable rates and destination. - Store-view-level configuration.
Installation
Composer (Recommended)
- Open your terminal and navigate to your Magento 2 root directory.
- Run the following command:
composer require taurus-media/module-structured-data-category
- Enable the module:
bin/magento module:enable Taurus_StructuredDataCategory bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Configuration
- Log in to the Magento 2 Admin panel.
- Navigate to Stores > Settings > Configuration.
- Go to Taurus > Structured Data Category > CollectionPage.
- Available settings:
| Setting | Default | Description |
|---|---|---|
| Enabled | Yes | Output the CollectionPage markup on category pages. |
| Add Product Offers | Yes | Add the offers element to each product. |
| Add Offer Shipping Details | No | Add shippingDetails to each offer. Shown only when offers are enabled. |
| Shipping Min Rate | – | shippingRate.minValue. Shown only when shipping details are enabled. |
| Shipping Max Rate | – | shippingRate.maxValue. Shown only when shipping details are enabled. |
| Shipping Destination | – | shippingDestination.name, e.g. Global. Optional. |
shippingDetails is skipped if both rates are empty.
- Click Save Config and flush the cache.
Output Example
{
"@context": "https://schema.org",
"@type": "CollectionPage",
"@id": "https://example.com/gear/bags.html#collectionpage",
"name": "Bags",
"url": "https://example.com/gear/bags.html",
"description": "Bags",
"publisher": {
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Store",
"url": "https://example.com/",
"logo": { "@type": "ImageObject", "url": "https://example.com/media/logo/default/logo.png" }
},
"breadcrumb": {
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https://example.com/" },
{ "@type": "ListItem", "position": 2, "name": "Gear", "item": "https://example.com/gear.html" },
{ "@type": "ListItem", "position": 3, "name": "Bags", "item": "https://example.com/gear/bags.html" }
]
},
"mainEntity": {
"@type": "ItemList",
"@id": "https://example.com/gear/bags.html#PLP",
"url": "https://example.com/gear/bags.html",
"numberOfItems": 1,
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@type": "Product",
"url": "https://example.com/push-it-messenger-bag.html",
"name": "Push It Messenger Bag",
"id": "https://example.com/push-it-messenger-bag.html#PDP",
"offers": {
"@type": "Offer",
"priceCurrency": "USD",
"price": 45,
"itemCondition": "https://schema.org/NewCondition",
"availability": "https://schema.org/InStock",
"url": "https://example.com/push-it-messenger-bag.html",
"shippingDetails": {
"@type": "OfferShippingDetails",
"shippingRate": { "@type": "MonetaryAmount", "minValue": 5.99, "maxValue": 49.99, "currency": "USD" },
"shippingDestination": { "@type": "DefinedRegion", "name": "Global" }
}
}
}
}
]
}
}
Notes
mainEntityis omitted for categories with the "Static block only" display mode.- The core breadcrumbs block has no public getter for its crumbs, so
Plugin\BreadcrumbsPluginkeeps a copy of them in the block'scrumbs_listdata. - JSON is encoded with
JSON_HEX_TAG | JSON_HEX_AMP, so admin-entered values can't break out of the<script>tag. - Hyvä's breadcrumbs template outputs its own standalone
BreadcrumbList. Both blocks can coexist.
License
MIT