Monday 19th of May 2014
How to insert a manual ‘menu alias’ link into a Joomla! article or custom html module. Have you ever wanted to insert a link to a menu item inside an article or module? Click the link below to learn more.
How to insert a manual ‘menu alias’ link into a Joomla! article or custom html module.
Have you ever wanted to insert a link to a menu item inside an article or module?
One way to do it is to copy the url and paste it into the link:
- http://www.yourdomain.com/index.php/about-us (absolute)
- index.php/about-us (relative without extension)
- index.php/about-us.html (relative with extension)
Any of the above methods will work and they are okay for one off links or if your site is already live, but what if you are working on a site at a temporary url or local version while you are developing the site?
You can’t use the SEO re-write when working on a temporary url or server path (http://111.112.123.1/~mysite or http://localhost/mysite) so you need to include the 'index.php' name in your url links. When your site finally goes live and you turn on the Joomla! re-write feature (which removes the index.php) the manual url links will now be different to the actual menu link.
Another issue with direct links is if you change the alias name for example about-us becomes just about. Once you have updated the menu alias, all other links throughout the site will also need to be changed manually to match the updated menu alias.
Instead of using the url as described above you should be using the ‘alias link’; when using this method it will automatically update and rename itself if you ever change the menu link or turn on SEO re-write because it uses the menu’s id number and not the alias. You can even move the menu link to a sub menu (e.g. contact-us/about-us) and the link in the article will automatically be renamed.
To use it you just need to note down the menu id number by going to the menu within the menu manager and note down the links id number that you want to use; it appears on the right side of the menu list.
Now that we have menu’s id, we’re ready to insert the link in to an article. In edit mode you insert the link as usual but this time we are going to use the following call:
index.php?Itemid=(number of menu id here)
index.php?Itemid=150
When viewed in the frontend of the site, this link will automatically be re-written to whatever the menu alias is. e.g. about-us or index.php/about-us.
This will work with or without the SEO re-write feature. It will include the ‘index.php/about-us’ in the url path if SEO re-write is off and it will exclude it if SEO re-write is on ‘about-us’.
Enjoy.
If you have any questions, please don’t hesitate to contact our support team, you can get in touch through our User Support system. If you have any other questions or comments feel free to browse through our Contact page, Facebook, Twitter and Google+ pages!