问题描述
我尝试在TYPO3 9.5的操作链接中创建口语URL,以使下一页知道用户来自何处.
I try to create speaking URL out of an action-link in TYPO3 9.5 to let the next page know from where the user came from.
当我将此代码用于操作链接时:
When I use this code for the action-link:
<f:link.action pageUid="296" action="show" controller="Author" arguments="{author : blogentry.author, categoryParent : filtercategories.uid}"> {blogentry.author.firstname} {blogentry.author.surename}
</f:link.action>
,这在我的config.yaml中:
and this in my config.yaml:
BlogAuthorPluginShow:
type: Extbase
extension: Blog
plugin: Blogauthors
routes:
- routePath: '/{author_title}'
_controller: 'Author::show'
_arguments:
'author_title': author
defaultController: 'Author::list'
aspects:
author_title:
type: PersistedAliasMapper
tableName: 'tx_ivsblog_domain_model_author'
routeFieldName: 'pathsegment'
由于第二个参数(, categoryParent : filtercategories.uid
),它不起作用.如果我删除第二个参数并这样写,它将起作用:
it doesn't work because of the second argument (, categoryParent : filtercategories.uid
). If I remove the second argument and write it like this it works:
<f:link.action pageUid="296" action="show" controller="Author" arguments="{author : blogentry.author}"
> {blogentry.author.firstname} {blogentry.author.surename}
</f:link.action>
我该如何管理它以为控制器提供第二个参数并让工作?
How can I manage it to give the controller a second argument and make the slug work?
推荐答案
自变量categoryParent
未在config.yaml
中注册.我不确定是否足以注册并在那里使用它,但我认为这是最低要求.
The argument categoryParent
is not registered in config.yaml
.I'm not sure if it's enough to register it and use it there but i'd consider it as minimum requirement.
这篇关于TYPO3-Slug无法在f:link.action中使用多个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!