索引搜索无法从标题搜索框中完全返回结果。 当我在那里开始搜索时,它会转到右页并将搜索到的单词带到搜索页面的搜索字段中,但不会搜索它。 如果我然后单击插件所在的一侧搜索,它会给我结果。 这是我的TypoSrict:http://pastebin.com/yQ0UWdjn
我的常数:
plugin.tx_indexedsearch {
view {
templateRootPath = EXT:my_distribution/Resources/Private/Templates/
partialRootPath = EXT:my_distribution/Resources/Private/Partials/
layoutRootPath = EXT:my_distribution/Resources/Private/Layouts/
}
settings {
targetPid = 11
rootPidList = 1
}
}
从扩展程序中复制模板,部分,布局。
答案 0 :(得分:1)
对于extbase索引搜索,您应该使用以下示例代码重命名搜索表单字段的name属性,并将其放在流体模板而不是TypoScript中。
<f:form pageUid="{settings.searchPage}" extensionName="indexedsearch" id="headerSearchForm">
<div class="input-group">
<f:form.textfield class="form-control search" name="tx_indexedsearch[sword]" />
<span class="input-group-btn">
<button class="btn btn-primary" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</f:form>
答案 1 :(得分:0)
感谢Manthan的帮助。 这是最终版本:
<div class="searchbox">
<div class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" title="Webseite durchsuchen..." aria-expanded="true"> <span class="glyphicon glyphicon-search"></span> </a>
<div class="dropdown-menu" style="padding: 0 15px; min-width: 250px;">
<f:form pageUid="{settings.indexedSearchResult}" action='search' extensionName="indexedsearch" controller='Search' pluginName='Pi2' id="headerSearchForm" style="width:100%;" class="navbar-form">
<div class="input-group">
<f:form.textfield class="form-control search" name="search[sword]" placeholder="Webseite durchsuchen..." />
<span class="input-group-btn">
<button class="btn btn-default" type="submit" name="submitButton"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</f:form>
</div>
</div>
</div>
答案 2 :(得分:0)
对于仍然遇到问题的其他人,这是我的V8.7.19解决方案(希望与v6-v9兼容)
首先,输入搜索字段的pageUId。我是在模板设置中这样做的:
page.10.settings.searchTargetPid = 119 //This is my pid number
接下来,在我自己的私有模板文件夹中,我使用以下html创建了搜索表单:
<f:form method="post" pageUid="{settings.searchTargetPid}" name="tx_indexedsearch" extensionName="indexedsearch" pluginName="pi2" action="search" controller="Search">
<f:form.textfield name="search[sword]" value="{sword}" />
<f:form.submit name="search[submitButton]" value="Search" id="tx-indexedsearch-searchbox-button-submit" />
</f:form>
请注意表单参数的使用: