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
- Go to the Modules Anywhere page and click the "Download Free" button.
- 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.
- You will see the Select a Module Type list.
- Scroll slightly down and click Search.
- Enter My Search for Top Menu in the Title field.
- Find the Show Title setting and set it 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.
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.
- Select your top menu from the Menu field. In my case, this is the Main Menu.
, including the curly brackets, in the Menu Title box.
- Click Select.
- You will see the Menu Item Type modal box. Go to System Links > Separator.
- Click Save & Close.
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.
Alternative Option: Use Shack Search
Shack Search is a free extension. It is an improved search module that displays search results in real time:
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.