TYPO3 v9 中索引搜索的预填充搜索字段
prefill search field of indexed search in TYPO3 v9
我想知道如何在 TYPO3 v9 中的新 indexed_search 上预填充搜索字段。在旧版本中,我在网站的头部放置了一个搜索字段:
<form method="post" action="https//linktomysearchpage" style="margin:0;">
<input type="text" placeholder="Suche" name="tx_indexedsearch[sword]"><span class="site-search-bg">
<button type="submit" name="tx_indexedsearch[submit_button]"><i class="icon-lupe"></i></button>
使用 indexed_search 插件从该输入字段跳转到搜索页面时,插件的搜索字段会被填充并显示结果列表。
但是在版本 9 中,这不再有效。有些东西变了。
有什么帮助吗?
谢谢!
您不应使用普通模板 html,而应使用流体模板(模板现在是基于流体的)。在所有页面上集成“header 搜索框”的示例如下:
lib.searchBox = USER
lib.searchBox {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = TYPO3\CMS
extensionName = IndexedSearch
pluginName = Pi2
switchableControllerActions {
Search {
1 = form
2 = search
}
}
view =< plugin.tx_indexedsearch.view
view {
templateRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Templates/
}
partialRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Partials/
}
layoutRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Layouts/
}
}
settings =< plugin.tx_indexedsearch.settings
}
我想知道如何在 TYPO3 v9 中的新 indexed_search 上预填充搜索字段。在旧版本中,我在网站的头部放置了一个搜索字段:
<form method="post" action="https//linktomysearchpage" style="margin:0;">
<input type="text" placeholder="Suche" name="tx_indexedsearch[sword]"><span class="site-search-bg">
<button type="submit" name="tx_indexedsearch[submit_button]"><i class="icon-lupe"></i></button>
使用 indexed_search 插件从该输入字段跳转到搜索页面时,插件的搜索字段会被填充并显示结果列表。
但是在版本 9 中,这不再有效。有些东西变了。 有什么帮助吗? 谢谢!
您不应使用普通模板 html,而应使用流体模板(模板现在是基于流体的)。在所有页面上集成“header 搜索框”的示例如下:
lib.searchBox = USER
lib.searchBox {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = TYPO3\CMS
extensionName = IndexedSearch
pluginName = Pi2
switchableControllerActions {
Search {
1 = form
2 = search
}
}
view =< plugin.tx_indexedsearch.view
view {
templateRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Templates/
}
partialRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Partials/
}
layoutRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Layouts/
}
}
settings =< plugin.tx_indexedsearch.settings
}