How to get specific menu items from joomla?

Viewed 37112

This question is bit specific for Joomla.

I have a main menu consisting of:

Home|About US|Privacy Policy|Portfolio|Contacts US.

Each menu item is link to an article.

Now on the complete site there are many places in the components and modules where I need to show two links : Privacy Policy & Portfolio.

Can someone please guide me? I do not want to hard code the links as the item id would differ in production.

9 Answers

I think you should create a new menu in joomla then make aliases type of menu items, you should do this to make sure you don't get duplicate content issues. I think Alex answer is ok if you want to do it with code but its harder to maintain and for someone to understand who comes along. As it is a menu item it doesn't belong in a component or module in my opinion.

$app = JFactory::getApplication();
$menu = $app->getMenu();
$items = $menu->getItems('menutype', 'mainmenu');
Related