我有自己的扩展,有两个动作控制器:listAction和showAction。
问题:我可以在同一页面显示两项操作吗?TYPO3 Extbase switchableControllerActions
在特定页面我创建了一个插件插件记录,使用我自己的插件在插件的后端配置的flexform中,我通过switchableControllerActions字段选择了“list action”。列表操作包含与产品展示操作链接的产品列表。
那么我想要什么?
F.e. 我有页面产品。网址为example.com/products(这是我的名单行动)
而对于表演动作我想要的网址类似example.com/products/name-of-product
我已经发现了这个功能的扩展。这是gb_events。我注意到在插件的flexform的switchableControllerActions字段中有这样的东西:
<switchableControllerActions>
<TCEforms>
<label>LLL:EXT:gb_events/Resources/Private/Language/locallang_db.xlf:flexform.default.switchableControllerActions</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:gb_events/Resources/Private/Language/locallang_db.xlf:flexform.default.switchableControllerActions.upcoming</numIndex>
<numIndex index="1">Event->upcoming;Event->list;Event->calendar;Event->show;Event->export</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:gb_events/Resources/Private/Language/locallang_db.xlf:flexform.default.switchableControllerActions.list</numIndex>
<numIndex index="1">Event->list;Event->upcoming;Event->calendar;Event->show;Event->export</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:gb_events/Resources/Private/Language/locallang_db.xlf:flexform.default.switchableControllerActions.calendar</numIndex>
<numIndex index="1">Event->calendar;Event->upcoming;Event->list;Event->show;Event->export</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">LLL:EXT:gb_events/Resources/Private/Language/locallang_db.xlf:flexform.default.switchableControllerActions.details</numIndex>
<numIndex index="1">Event->show;Event->list;Event->upcoming;Event->calendar;Event->export</numIndex>
</numIndex>
</items>
<maxitems>1</maxitems>
<size>1</size>
</config>
<onChange>reload</onChange>
</TCEforms>
</switchableControllerActions>
我已经更新了我的flexform配置。但它仍然不起作用。当我点击链接show action后,我有相同的列表视图。
在此先感谢。我会感谢任何帮助。
感谢您的回答。这是一个好主意,就像你在这里描述的那样:) 如果我有足够的声望,我会投票。 – andr 2016-08-11 21:10:38