Ashwini
Ashwini

Reputation: 125

How to add the AEM search component in header and display search results in the main content?

I am working on AEM search component. I overlaid this component and added that in the header part of my page. But I need to get the search results in the main content of the page. How do I do that? Thanks in advance!

Upvotes: 0

Views: 2133

Answers (1)

Ameesh Trikha
Ameesh Trikha

Reputation: 1712

You could refer to the way the search component has been setup with Geometrixx-Outdoor Site

  • Open en.html and enter design mode
  • Check the configuration on the search box, you will see Search Path configured
  • What this component does it that it appends the search text to this path and calls a redirect to it Search Configuration
  • Next open up this page /content/geometrixx-outdoors/en/toolbar/search, here the search component is dropped and configured. This component is responsible for displaying the search results as well as accepting new search terms. This component script can be found at /libs/foundation/components/search/search.jsp

Search page - results

  • Also look here - /etc/designs/geometrixx-outdoors/jcr:content/page/search, this is where the design configuration for the search configured in header is stored

So effectively there are two components -

  • /apps/geometrixx-outdoors/components/page/search placed in header
  • /libs/foundation/components/search placed on search result page

Upvotes: 1

Related Questions