Typo3 可切换控制器动作不工作类型3 7.6
嗨,我有一个打字37.6的分机。我有两个动作列表和显示。在我的flexform中,有一个可切换的控制器操作。列表操作正在工作。但表现出行动不起作用。请检查我的密码 柔性模板Typo3 可切换控制器动作不工作类型3 7.6,typo3,extbase,typo3-7.6.x,Typo3,Extbase,Typo3 7.6.x,嗨,我有一个打字37.6的分机。我有两个动作列表和显示。在我的flexform中,有一个可切换的控制器操作。列表操作正在工作。但表现出行动不起作用。请检查我的密码 柔性模板 <switchableControllerActions> <TCEforms> <label>Display Type</label>
<switchableControllerActions>
<TCEforms>
<label>Display Type</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<items type="array">
<numIndex index="1" type="array">
<numIndex index="0">List</numIndex>
<numIndex index="1">News->list</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">Detail</numIndex>
<numIndex index="1">News->show</numIndex>
</numIndex>
</items>
<minitems>0</minitems>
<maxitems>1</maxitems>
<size>1</size>
</config>
</TCEforms>
</switchableControllerActions>
显示类型
重新加载
选择
列表
新闻->列表
细节
新闻->节目
0
1.
1.
列表视图
<f:if condition="{news}">
<ul>
<f:for each="{news}" as="item">
<li>
<f:link.action action="show" controller="News" arguments="{news:'{item}'}" noCacheHash="false" pageUid="{settings.detailPid}" >
{item.title}
</f:link.action>
</li>
</f:for>
</ul>
</f:if>
-
{item.title}
我从列表页面的配置中选择了列表,并从详细信息页面中选择了详细信息。列表工作正常,但详细信息不起作用。尝试添加如下参数:
arguments="{news: item.uid}"
$newsId = $this->request->getArgument('news');
$news = $this->newsRepository->findByUid($newsId);
$this->view->assign('news', $news);
在showAction中,您可以得到如下参数:
arguments="{news: item.uid}"
$newsId = $this->request->getArgument('news');
$news = $this->newsRepository->findByUid($newsId);
$this->view->assign('news', $news);
它将按照您的要求完美工作。尝试添加如下参数:
arguments="{news: item.uid}"
$newsId = $this->request->getArgument('news');
$news = $this->newsRepository->findByUid($newsId);
$this->view->assign('news', $news);
在showAction中,您可以得到如下参数:
arguments="{news: item.uid}"
$newsId = $this->request->getArgument('news');
$news = $this->newsRepository->findByUid($newsId);
$this->view->assign('news', $news);
它将按照您的要求完美工作
未显示任何错误消息。仅显示空白页
你可能想先改变一下
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Vendor.ext_key',
'News',
array(
'News' => 'list,show'
)
);
如果使用控制器->动作组合(与其他组合类似)传递第四个参数,则可以定义不应缓存的动作。您可以使用这些配置表单操作或可筛选结果列表
注意:在ext_localconf.php和其他引导文件中始终使用完整名称空间,如果使用“use”语句,则可能会出现另一个致命错误,typo3会连接所有这些引导文件。
此外,您可能误解了switchableControllerActions模式。如果你想让一个插件(ce)同时显示两个动作,那么这个选项必须是
<switchableControllerActions>
<TCEforms>
...
<config>
<type>select</type>
<items type="array">
...
<numIndex index="3" type="array">
<numIndex index="0">List with Details</numIndex>
<numIndex index="1">News->list;News->show</numIndex>
</numIndex>
</items>
...
</config>
</TCEforms>
</switchableControllerActions>
...
选择
...
详列
新闻->列表;新闻->节目
...
所选选项将保存在xml数据结构中,并用作配置,因此,如果此实例只有一个操作可用,则您将收到一个错误
如果使用不同的内容元素显示列表和详细视图,则必须在两个内容元素中选择正确的switchableControllerAction选项
未显示任何错误消息。仅显示空白页
你可能想先改变一下
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Vendor.ext_key',
'News',
array(
'News' => 'list,show'
)
);
如果使用控制器->动作组合(与其他组合类似)传递第四个参数,则可以定义不应缓存的动作。您可以使用这些配置表单操作或可筛选结果列表
注意:在ext_localconf.php和其他引导文件中始终使用完整名称空间,如果使用“use”语句,则可能会出现另一个致命错误,typo3会连接所有这些引导文件。
此外,您可能误解了switchableControllerActions模式。如果你想让一个插件(ce)同时显示两个动作,那么这个选项必须是
<switchableControllerActions>
<TCEforms>
...
<config>
<type>select</type>
<items type="array">
...
<numIndex index="3" type="array">
<numIndex index="0">List with Details</numIndex>
<numIndex index="1">News->list;News->show</numIndex>
</numIndex>
</items>
...
</config>
</TCEforms>
</switchableControllerActions>
...
选择
...
详列
新闻->列表;新闻->节目
...
所选选项将保存在xml数据结构中,并用作配置,因此,如果此实例只有一个操作可用,则您将收到一个错误
如果使用不同的内容元素显示列表和详细视图,则必须在两个内容元素中选择正确的switchableControllerAction选项。确保在给定的
{