【发布时间】:2014-10-08 19:03:01
【问题描述】:
我有自己的扩展,它有两个动作的控制器:listAction 和 showAction。
问题:我可以在同一页面上显示两个操作吗?
在特定页面上,我使用自己的插件创建了一个插入插件记录,在插件后端配置的 flexform 中,我通过 switchableControllerActions 字段选择了“列表操作”。列表操作包含产品列表,其中包含指向产品展示操作的链接。
那我想要什么?
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 配置。但它仍然不起作用。当我单击带有显示操作的链接后,我有相同的列表视图。
提前致谢。我将不胜感激。
【问题讨论】: