我正在使用 TYPO3 版本 8,我已经安装了带有打字稿的 indexed_search 表单框
50 = COA
50 {
stdWrap {
wrap = <div id="searchcontainer">|</div><div class="clearboth"></div>
required = 1
}
10 = TEXT
10 {
wrap = <form id="searchbox" name="searchbox" action="|" method="post">
typolink.parameter = {$searchPID}
typolink.returnLast = url
if.isTrue = {$config.tx_realurl_enable}
}
20 = TEXT
20 {
value = <form id="searchbox" name="searchbox" action="/" method="post">
if.isFalse = {$config.tx_realurl_enable}
}
30 = COA
30 {
10 = TEXT
10{
wrap = <input type="hidden" name="id" value="|" />
value = {$searchPID}
if.isFalse = {$config.tx_realurl_enable}
}
20 = TEXT
20 {
wrap = <input type="text" id="swords" name="swords" value="|" size="20" onfocus="this.value='';" />
value = {$searchTEXT}
}
30 = TEXT
30 {
wrap = <input type="submit" id="searchbutton" value="" />
}
}
40 = TEXT
40 {
value = </form>
}
}
Run Code Online (Sandbox Code Playgroud)
当我点击搜索时,我被重定向到我的搜索页面,其中包含安装的搜索插件,但没有搜索结果,甚至没有显示关键字。页面索引良好,在后端索引中搜索关键字出现,但不在前端,我在这里缺少什么?请帮忙!
您可以<f:form>在 FLUIDTEMPLATE 中使用以生成 Quicksearch-Form。这样,一个基本的 cHash 参数将自动生成并附加到操作 URL。
TypoScript(常量)
plugin.tx_indexedsearch.settings.targetPid = 35
Run Code Online (Sandbox Code Playgroud)
TypoScript(设置)
lib.quicksearch = FLUIDTEMPLATE
lib.quicksearch{
file = fileadmin/Quicksearch.html
settings.targetPid = {$plugin.tx_indexedsearch.settings.targetPid}
}
Run Code Online (Sandbox Code Playgroud)
快速搜索.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div id="quicksearch">
<f:form action="search" method="post" controller="Search" extensionName="indexedsearch" pluginName="pi2" pageUid="{settings.targetPid}">
<f:form.textfield name="search[sword]" value="{sword}" class="quicksearch-sword" />
<f:form.submit name="search[submitButton]" value="Search" class="quicksearch-submit" />
</f:form>
</div>
</html>
Run Code Online (Sandbox Code Playgroud)
小智 5
user2714261 展示了如何停用所有元素的 cHash 检查。这实际上可能有点冒险。但您只能针对indexed_search 插件停用它。这不会有任何问题,因为 indexed_search 无论如何都不应该缓存。所以你可以在你的插件设置中编写:
plugin {
tx_indexedsearch {
features.requireCHashArgumentForActionArguments = 0
}
}
Run Code Online (Sandbox Code Playgroud)
这在 TYPO3 8.7.9 中运行良好。
马丁