TYPO3 Documentation
Faceted Search
Options
Give feedback View source View as Markdown How to edit Edit on GitHub

Faceted Search

  • Introduction
  • Examples
  • Quick start
  • Indexing
    • Pages
    • Content Elements
    • News (EXT:news)
    • News (EXT:tt_news)
    • Addresses (EXT:tt_address)
    • Files
    • Custom Indexer
    • Indexing custom content fields
    • Database Indexer Configuration
    • YAML Indexer Configuration
    • Full indexing and incremental indexing
  • Backend
  • Filters / Faceted Search
    • Setup filters
    • Tag based filters
    • Date range filter
    • Using system categories for filtering
    • Custom Filter
  • Templating
    • Use your own CSS
    • Use your own templates
    • Searchbox on every page
    • Images
    • Template Selector
    • Custom values in the search result list
    • Link view helper
    • Render filters in result list
  • Configuration
    • Additional word characters
    • Allow only ke_search records on a page
    • Avoid 404 error from cacheHash validation
    • Highlighted Word
    • TypoScript and FlexForm settings
    • Override record storage page (Startingpoint)
    • Reduce filters shown in the backend
    • Routing (Speaking URLs)
    • Search word length
    • Change the search word parameter
    • Sorting
    • Storage Engine
  • Multilangual support
  • Search behaviour
    • Search options
    • Ranking / Sorting
    • Stopwords
  • Statistics
    • Statistics using Google Analytics
    • Statistics using Matomo
  • Hooks and Events
  • Public Search API
  • Logging
  • Command line tools
  • Changelog
  • Premium version
  • Sitemap

Options

Give feedback View source View as Markdown How to edit Edit on GitHub
  1. Faceted Search
  2. Templating
  3. Searchbox on every page
Give feedback Markdown Edit on GitHub

Searchbox on every page 

There are multiple ways to integrate the searchbox on every page.

  • By creating a content element and including this on every page
  • As plain HTML
  • Directly using TypoScript

Note

Since version 4.2.0 there's a plugin "Cachable searchbox". It is recommended to use this over "Searchbox" because this plugin won't disable caching of the entire page where it's used. Only drawback is that the plugin options won't get updated by the search currently performed, e. g. all the filter options will be shown even if they do not appear in the result list (the normal searchbox will only show the options which are available in the result list).

Best practice is to include the "Cachable searchbox" on every page and then on the result page use standard "Searchbox" plugin.

Including searchbox as a content element 

  • Create a folder where you want to store the searchbox content element.
  • Insert a "Cachable searchbox" plugin and configure it as you wish.
  • Add that content element to every page with TypoScript, e. g.:
# Include searchbox as a content element
lib.searchbox = RECORDS
lib.searchbox {
   tables = tt_content
   source = 7
}
Copied!

Where 7 is the UID of your searchbox content element. You can then include the searchbox in your main page template, e. g.:

page = PAGE
page.5 < lib.searchbox
page.10 < styles.content.get
Copied!

On the search result page you should then remove the searchbox:

page.5 >
Copied!

Include searchbox with plain HTML 

# Include searchbox as plain HTML
lib.searchbox_html = TEXT
lib.searchbox_html.value (
   <form method="get" id="form_kesearch_searchfield" name="form_kesearch_searchfield" action="/search/">
     <input type="text" id="ke_search_searchfield_sword" name="tx_kesearch_pi1[sword]" placeholder="Your search phrase" />
     <input type="submit" id="ke_search_searchfield_submit" alt="Find" />
   </form>
)

# Default PAGE object:
page = PAGE
page.5 < lib.searchbox_html
page.10 < styles.content.get
Copied!

The action "/search/" ist the slug of the page you created with your result list plugin.

Include searchbox with TypoScript 

This is only possible without displaying filters as they are configured in a FlexForm. If you need filters, it's recommended to include the searchbox as content element as shown above.

# Include searchbox as a plugin
lib.searchbox_plugin = COA
lib.searchbox_plugin {
   10 < plugin.tx_kesearch_pi3

   # result page
   10.resultPage = 123

   # CSS file
   10.cssFile = EXT:ke_search/Resources/Public/Css/ke_search_pi1.css

   # Content element (search box plugin) from which additional
   # configuration should be loaded (UID of content element).
   # Important: If you have two search boxes on your result page
   # (eg. in the top and in the left area), you should set this value!
   # 10.loadFlexformsFromOtherCE = 123456
}
Copied!

The number 123 in this case is a placeholder for the page ID you created with your result list plugin.

You can then include the searchbox in your main page template, e. g.:

page = PAGE
page.5 < lib.searchbox_plugin
page.10 < styles.content.get
Copied!

On the search result page you should then remove the searchbox:

page.5 >
Copied!
  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Issues
  • Repository

Last rendered: Nov 13, 2026 11:21

© since 2011 by ke_search Dev Team
  • Legal Notice
  • Privacy Policy