Joomla Hidden Menus

Joomla Hidden Menus

September 12, 2019 12 By Bernardo Ryan


This is Richard Pearce from Build a Joomla Website with a quick Joomla tutorial. There are several reasons why using a content management system is better than a static website. You don’t need any local software, so updates can be made from any Internet connected computer or mobile device. Multiple people can make changes. And if a change needs to be made to multiple pages, this is usually easier and faster with a CMS. There are downsides too and in this video, you’ll discover the challenge of implementing a hidden page on a Joomla website. There are occasions when you need to create a page to tie in with some sort of functionality. For example, you might have a feedback form that when submitted, redirects to a “thank you” page. Or perhaps you have some sort of third-party payment system that redirects the customer back to a particular page on your site after a successful transaction. These confirmation pages should only appear as part of the related process, so you don’t want a link to them in a menu. Obtaining the appropriate link might seem easy, but getting the page to look the way you want it to, isn’t so obvious. Let’s go through the entire process. Step 1. Create a new category – You don’t want confirmation pages mixed in with your regular articles. So create a specific category and in this case I will call mine hidden. Step 2. Create the confirmation article – Just as you would any other article and store it in the category you created in the first step. Step 3. Create a new Menu by going to Menus – Menu Manager – Add New Menu. Give it a title and a name. There is no need to create an associated menu module because you don’t want the the links in this menu to appear on the website. Step 4. Create a new menu item in the new menu. You’ll most likely want to use the Single Article option. And then select the article that was created in step 2. Now there are two pieces of information to collect from this page. The first is the Link field which shows index.php?option=com_content&view=article
That’s the first part of the URL that will point to this article. Save this article and then note that this changes and its too long to read. Click the cursor within this box and select everything. This can be a bit tricky with the mouse so use CTRL+A on Windows or Command+A on a Mac. Then copy. That’s CTRL+C or Command+C. Now I’ll come back to this, but while we’re here, also make a note of the number next to ID which in this case is 539. 23
00:04:25,466 –>00:04:36,566
Step 5. Go to the frontend home page and paste the URL after the domain name. It should look something like www.whateveryourdomainname.whatever/index.php?option=com_content&view=article&id=81. This is the confirmation page and at first glance it looks okay. But note that the word Articles appears at the top. And how do you control which modules appear on this page? These challenges occur because Joomla doesn’t recognise this page. Pages are created by menu items and although we specified the article ID number, Joomla also needs to know about the menu. And that’s where the second piece of information is needed. 28
00:05:32,733 –>00:05:44,933
Step 6. Add the menu ID number to the end of the URL. The number in this case is 539. If you forget this, go back to the appropriate menu page and look for this in the last column labelled ID. Then add this to the end of the URL:
&Itemid=539 So in this example the full url becomes index.php?option=com_content&view=article&id=81&Itemid=539 where id=81 would be the article ID number and Itemid=539 is the menu ID number. Note that the first I in Itemid must be a capital I. Now the word Articles has disappeared and you can manipulate modules on this page as you please. Let’s remove the Users Latest module. Go to Module Manager, find the module and choose the option to display the module on all pages except the one specified. And check the hidden page, the confirmation page on the hidden tab, so the module doesn’t display on this page. Save and refresh the frontend to see that the module has been removed. You might be tempted to just try this last step without bothering to add the menuid, but it doesn’t work. If I load the page with the menu id in the URL, the module returns to where it was. And once again, this is because we haven’t told Joomla about our desired menu, so it doesn’t know which modules to display. One last thing to mention. These are of course Joomla’s native URL’s as opposed to search engine friendly URL’s. That’s not an issue because you don’t want these pages indexed by search engines anyway. They’re purely to be used to paste into the relevant field within whatever extension or off-site application you’re using. In fact, it’s a good idea to hide these pages from search engines by going back to the menu item and look at Metadata – Robots, Noindex. In theory robots shouldn’t find these pages because they don’t exist in a menu. But if you are using a sitemap extension, the URL might get added to this without your knowledge. If a search engine happens to find the page, it will not index it if you enable this setting. For more great Joomla training, head to www.buildajoomlawebsite.com