[英]TYPO3 CMS 9 LTS: PersistedAliasMapper with same slugs in different storagePids
I've got a setup with two sites.我有两个站点的设置。 Each site has an extension for my model tx_myext_domain_model_product and this product has a slug.
每个站点都有我的 model tx_myext_domain_model_product 的扩展名,这个产品有一个 slug。 The slug is unique for a site, but not within the whole instance.
slug 对于一个站点是唯一的,但不是在整个实例中。 So,
product-a
may be the same slug for two different products, residing in different storagePids.因此,
product-a
可能是两个不同产品的同一个 slug,驻留在不同的 storagePid 中。
Using the usual PersistedAliasMapper I cannot find a way to define the storage pid for the mapped record, so in some cases I get the wrong record.使用通常的 PersistedAliasMapper 我找不到为映射记录定义存储 pid 的方法,因此在某些情况下我得到了错误的记录。
routeEnhancers:
Products:
aspects:
slug:
type: PersistedAliasMapper
tableName: tx_myext_domain_model_product
routeFieldName: slug
A quick visualization:快速可视化:
uid, pid, title, slug, description
"1", "10 [in Site A]", "Product A", "product-a", "Description in Site A"
"2", "20 [in Site B]", "Product A", "product-a", "differing description in Site B"
Is there a way to define the storagePid, so the mapping query fetches not only by mapped title, but also by folder (or site)?有没有办法定义 storagePid,所以映射查询不仅可以通过映射的标题,还可以通过文件夹(或站点)获取?
Thanks for your help!谢谢你的帮助!
Seems to have been a bug prior to 9.5.15/9.5.16.似乎是 9.5.15/9.5.16 之前的一个错误。 I updated from.14 to.16 and the behavior is correct now.
我从.14 更新到.16,现在行为是正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.