Search code examples
htmlsearchtypo3content-management-systemtyposcript

TYPO3 Ke_Search: How do I have multiple search forms on one page without them interfering each other?


I have a search form in my header rendered as a cObject from a content element which is a ke_search searchbox and it leads to a /search page when submitting. I also have subpages that are supposed to only look through seperately indexed pages like news and other pages. For that I have folders in the typo-backend which contain indexer configs.

My problem is that when I set up that search box in the header the other searches are using the indexer config from the header (probably because it's the first searchbox on that page). How do I make sure that every searchbox uses it's correct index?

As mentioned: Everythings seems to be split up nicely in the backend. I can only imagine that somethings going wrong because the searchboxes are rendered with the same id but how can I make sure they render with diffrent ID's?


Solution

  • I managed to get an answer from the team behind Ke_Search.

    When implementing a global searchbox that is used across every page, you should implement the searchbox as plain html and not as a content element in Typo3. You can only have one searchform as a content element per page.

    Here's the documentation on how to implement the html version: https://docs.typo3.org/p/tpwd/ke_search/main/en-us/Templating/Searchbox.html#include-searchbox-with-plain-html

    Just leaving this here for anyone running into the same issue.