Route Enhancers
To get speaking URLs it's necessary to add a Route Enhancer for the detail view.
Be aware that you need to adapt the limit
entry.
config/sites/<your-site>/config.yaml
routeEnhancers:
CartProducts:
type: Extbase
limitToPages:
- 123
extension: CartProducts
plugin: ShowProduct
routes:
- routePath: '/{product-title}'
_controller: 'Product::show'
_arguments:
product-title: product
defaultController: 'Product::show'
aspects:
product-title:
type: PersistedAliasMapper
tableName: tx_cartproducts_domain_model_product_product
routeFieldName: path_segment
Copied!
Note
Multi-site setup
The TCA configuration for path_
sets eval = unique
.
On a TYPO3 setup with multiple sites (= multiple roots) every site can have
its own product with the same path segment. This means all sites can have
an individual product with the path segment t-
.
Due to this setting it is not possible to share products between multiple sites. To achieve this you need to set
sitepackage/Configuration/TCA/Overrides/tx_cartproducts_domain_model_product_product.php
$GLOBALS['TCA']['tx_cartproducts_domain_model_product_product']['columns']['path_segment']['config']['eval'] = 'unique';
Copied!