How to Display a Search Module in a Joomla Menu

How to Display a Search Module in a Joomla Menu

It's very common for websites to put features inside top menus. You may find some sites do this with a login form. Other sites may include an advertisement or search box in their menu

In this tutorial, I'll show you how to add a search module to your Joomla menu. We won't use any coding in this tutorial. You will learn how achieve this either with the Modules Anywhere extension or with Shack Search.


In this first example, I'll show you how to add a module to a menu using the Modules Anywhere extension.

Step #1. Install Modules Anywhere

download modules anywhere
  • Login to your Joomla administrator area.
  • Go to Extensions > Manage.
  • Click the Upload Package File tab.
  • Click the Or browse the file green button.
  • Find the Modules Anywhere file you just downloaded and click on it twice to install it.

Excellent! You just installed the Modules Anywhere package to your site. It will help you embed a search module, or any other module for that matter, into your Joomla top menu.

Step #2. Create a Search Module

In this step, you will create the search module to be embedded in your top menu as a menu item.

  • Go to Extensions > Modules.
  • You will be taken to the Modules (Site) admin page. Click New.

click new

  • You will see the Select a Module Type list.

select a module type

  • Scroll slightly down and click Search.

click search

  • Enter My Search for Top Menu in the Title field.
  • Find the Show Title setting and set it to Hide.

set show title to hide

  • Click Save & Close.
  • You will see the Modules (Site) page once again. Find the My Search for Top Menu module you just created. Take notice of its ID number. In my example, the ID number is 35.

notice id number

Step #3. Create a Menu Item for the Search Module

Your newly created Search module is now ready to be displayed. Let's display it as a regular Joomla menu item in our top menu.

  • Go to Menus > <your top menu> > Add New Menu Item. For the purpose of this tutorial, I'll use my Main Menu.
add new menu item
 
  • Select your top menu from the Menu field. In my case, this is the Main Menu.

select main menu

  1. Enter , including the curly brackets, in the Menu Title box.
  2. Click Select.

enter module title click select

  • You will see the Menu Item Type modal box. Go to System Links > Separator.

system links separator

  • Click Save & Close.
You will see your new menu item listed with the rest of your top menu items.
list of menu items

Step #4. Check the Final Result

  • Visit your site front end. Take a look at your main menu. You will see that it now includes your Search module. Just as you planned at the beginning of this tutorial.
the results

Alternative Option: Use Shack Search

Shack Search is a free extension. It is an improved search module that displays search results in real time:

Shack Search displays search results as you type your search word

You can start using Shack Search module virtually instantly. 

  • Install it.
  • Assign it to the required Joomla pages.
  • That's all.

The module works nicely out of the box, with its default settings.