The Techjoomla Blog

Stay updated with all the latest happenings at Techjoomla. From news about the developments in your favourite extensions to Tips & Tricks about the Joomla CMS, Framework & Development.
Font size: +
1 minute reading time (195 words)

Adding a parameter to Joomla component's menu item is as easy as pie!

Adding a parameter to Joomla component's menu item is as easy as pie!

Hey Guys,
In this blog we are going to see how to add a parameter to a Joomla component's menu item. This parameter can be used while referring view level in Joomla 2.5.x or 3.x.
Following are the steps to achieve this.

Step 1:

You have to specify parameter / option in your_layout.xml file in your component.
Lets say, you have to add “pageLimit” parameter to default layout of a view named 'products'. For menu item, you have to create add default.xml for this layout and have to add parameter entry as given below.

a. Add a xml file at location


b. Add following code in above xml file

        All Products
        All Products View 


After adding the file, this parameter will be displayed while creating menu item for products view. Refer the following screen-shot for this.


Step 2 :

How to get menu parameter or options to use in queries?

// Getting menu Param
$menuParam = JFactory::getApplication()->getParams();
$pageLimit = $menuParam->get(pageLimit, 10);


 Using above code you can get menu parameter / option and can use it accordingly.

I hope this will help you. If there are any questions, feel free to add a comment. :)

Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Invitex 2.9 is here with Easysocial Apps and Plent...
Support Closure and Diwali Discounts

Related Posts


Blog Topics