您好,我在 TYPO3 Slack 频道上发现以下内容是一个人正在使用的内容。这个片段yaml
存在于/config/my-websitename/config.yaml
...
routeEnhancers:
NewsList:
type: Extbase
limitToPages: [2,20,21,22,92]
extension: News
plugin: Pi1
routes:
- routePath: '/p{page}'
_controller: 'News::list'
_arguments: {'page': '@widget_0/currentPage'}
- routePath: '/{news_title}'
_controller: 'News::detail'
_arguments: {'news_title': 'news'}
defaultController: 'News::list'
defaults:
page: '0'
requirements:
page: '\d+'
news_title: '^[a-zA-Z0-9].*$'
aspects:
page:
type: StaticRangeMapper
start: '1'
end: '100'
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
问题
但我注意到,当我有多篇标题相同的文章时,没有唯一的 URL。
问题
如何将文章添加uid
到路径以使其独一无二,或者这是一个好主意?我发现它在文档中被忽略了,但不知道如何让它发挥作用来扩展我已经拥有的东西,或者如果有人可以给我一个更好的例子来说明如何获取新闻的唯一网址?