Skip to main content

Joomla 3 tutorials

How to display search results on a new page in Joomla?

Many customers ask as how to configure the search module to display search results on completely different page than the search module is assigned to.
Why is it a problem?


For instance, if the search module is displayed on the home page only and there are many modules also assigned to the home page it may be inconvenient for site visitors to use the search module and look through search results among tons of modules :) 

It's all about ItemID.

The key issue is that the seacrh module uses the current menu ItemID unless there is no search component com_search assigned to any menu.
What is ItemID?
Go to Menus -> Your menu to check ItemID of any menu item.

menu-itemid


Of course it may be different for you home link. 
So assuming that you've got the searach module on home page, search results page will use home ItemID that you can see in the URL.

search-result-url

Tip:
If ItemID does not appear in the URL check if you have disabled SEO Settings -> Search Engine Friendly URLs.
It's recommended to enable this option at the end of working on the site (if you build it from scratch). 

 

Solution.

Edit the search module and navigate Options tab. There's Set ItemID filed that you can use to force search results to be displayed on the new page.

Display Search Results on a New Page in Joomla

 

Create hidden menu with the desired ItemID.

Do not have to use your current menu items for search results. You can create the menu that will not be published on the site but it will include the important information - the itemID of com_search component.

Step by step guide:

1. Create the new menu - called "hiddenmenu".

2. Create the new menu item.

3. Choose Search Form or Search Results (display search results) for Menu Item Type.

search-results-link


4. Check ItemId for this menu item. 

5. Enter ItemID in the Set ItemId filed.