5

Is it possible to show different search results ( on the basis of templates) in different tabs (one tab for one template like article/blog/documents) in same page for same keywords using SXA search components?

2
  • Have you considered using the tabs component, with a different search results component in each tab? Each search results component can have a different signature and scope. Jan 5, 2018 at 19:49
  • The tabs component providing the facility field to add tab heading with tab content in rich text format.
    – Amit Kumar
    Jan 6, 2018 at 2:30

2 Answers 2

3

Yes. All you have to do is to put two Search Results renderings on each tab and configure search scope.

Use search scope to define which templates should appear on the particular tab.

Search scope – select a scope to limit the search results.

source

I wrote a blog post about configuring search for blog purposes recently. This section describe how to create Search Scope and assign it.

If you've got a search filters on a page they will modify both Search Results results unless you define search signature

Search results signature – enter the unique signature of a specific Search 
Results rendering to limit the search results. This can be convenient when you have more than one search result rendering on the page.

source

1
  • The SXA OOTB component not allowing to add search results component, it only allows to add rich text content. In this how can we add the Search results component in Tab?
    – Amit Kumar
    Jan 9, 2018 at 13:19
1

Yes, it is possible to achieve this with OOTB SXA settings.

  1. Open the Control Properties for Search Box rendering and edit the following fields:
  • Search results signature – enter the unique signature of a specific Search Results rendering to limit the search results. This will be convenient when you have more than one search result rendering on the page. In our case, we’ll be having two search results rendering on the search page. Just placed all the Search Results signatures in the Search results signature separated by ",". enter image description here

  • Search results page – Select the specific search page, if you want to direct to a separate page. enter image description here

  1. Search result configuration: Open the search page in the experience editor.
  • Drag the Tab rendering from the toolkit and create new tab data items so that we can use the first tab for the document (items based on document template) search and the second tab for site-wide search. enter image description here

  • Drag and drop the Search results rendering in both tabs and use the below configuration for both. enter image description here

  • Set the Search Criteria for both search results:

Tab 1 search rendering Tab 1

Tab 2 search rendering Tab 2

  • Now you can provide a Search scope for each tab to restrict the search results.

For more details refer to this blog - https://sitecorewithraman.wordpress.com/2021/08/10/sxa-multiple-search-results/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.