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.

How to access Module parameters anywhere inside Joomla code?

How to access Module parameters anywhere inside Joomla code?

In Joomla, Module configurations are stored as Module parameters. Typically you only need to use parameters in the module itself. However, sometimes you might need to access them from other places like your component or a plugin. And this can get especially tricky when you have multiple copies of the module. 

A live case example for this is SocialAds Modules. In this case we need to know in places other than the module itself what parameters each copy of the SocialAds module is configured with.

This blog will show you how you can do this. 

Continue reading
1
  6610 Hits
  0 Comments
6610 Hits
0 Comments

How to access Joomla plugin parameters anywhere inside Joomla code?

How to access Joomla plugin parameters anywhere inside Joomla code?

When developing a new Joomla extension or making changes to existing extension, you might need to access plugin parameters of a Joomla plugin outside the plugin code. There can be cases where you want to access plugin parameters in some Joomla module or component. Now the question is - How to get plugin parameters outside the plugin code?

Here is a snippet of a Joomla code in PHP that lets you access plugin parameters anywhere inside Joomla.

// Get plugin 'my_plugin' of plugin type 'my_plugin_type'$plugin = JPluginHelper::getPlugin('my_plugin_type', 'my_plugin');// Check if plugin is enabledif ($plugin){	// Get plugin params	$pluginParams = new JRegistry($plugin->params);	$param1 = $pluginParams->get('param1');	$param2 = $pluginParams->get('param2');	$param3 = $pluginParams->get('param3');}

 

Continue reading
8
  9075 Hits
  0 Comments
9075 Hits
0 Comments

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

Continue reading
9
  19967 Hits
  0 Comments
19967 Hits
0 Comments