我有一个自写的 TYPO3 扩展(我曾经ext:extension_builder
创建它)
我的顶级 TypoScript 如下所示:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
format = html
file = EXT:cmsp/Resources/Private/Templates/User/Default.html
partialRootPaths {
10 = EXT:cmsp/Resources/Private/Partials/
}
layoutRootPaths {
10 = EXT:cmsp/Resources/Private/Layouts/
}
templateRootPaths
10 = EXT:cmsp/Resources/Private/Templates/
}
variables {
content_main < styles.content.get
content_main.select.where = colPos = 0
}
}
我使用了一个简单的流体样式内容模板:
<f:link.action controller="user" action="search" class="btn btn-secondary">action link</f:link.action>
该search
动作注册在ext_localconf.php
:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'SimpleParser.Cmsp',
'Cmspfe',
[
'User' => 'list,search'
],
// non-cacheable actions
[
'User' => 'list,search'
]
);
我还有一个模板Search.html
:
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Search" />
<f:section name="content">
<h1>Search Template</h1>
<f:flashMessages />
<table class="tx_cmsp" >
<tr>
<th> </th>
<th> </th>
</tr>
</table>
<form action="SearchConfim.php">
Searchterm: <input type="text" name="sTerm"><br>
<input type="submit" value="Submit">
</form>
</f:section>
</html>
问题是我无法在网站前端中创建或跟踪从顶级Default.html
(FLUIDTEMPLATE
对象)到Search.html
(Extbase 控制器模板)的链接:
<f:link.action controller="user" action="search" class="btn btn-secondary">action link</f:link.action>
Default.html
即使我单击控制器的操作链接,我也一直保持开启状态。我可以创建外部链接
<f:link.external ... ></f:link.external>
外部链接有效,但我无法使用链接访问Search.html
。也许问题是我使用的 TypoScript 没有激活控制器(以正确的方式)。但如果有人能帮助我,我很高兴。