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 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 let's 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 enabled
if ($plugin)
{
	// Get plugin params
	$pluginParams = new JRegistry($plugin->params);

	$param1 = $pluginParams->get('param1');
	$param2 = $pluginParams->get('param2');
	$param3 = $pluginParams->get('param3');
}

 

...
Rate this blog entry:
Continue reading
766 Hits
0 Comments

Our experiments with quality

Our experiments with quality

Last year was quite fruitful for us in terms of setting up several systems and processes to make sure our releases are more sharp and our code is much better. After several great suggestions and some oops! moments, we decided to pull up our socks and kicked off the slow but disciplined process of code review and infusing good quality into our products and projects. These are experiments and we are of course measuring what works best and will continue to tweak our quality process to further strengthen it

We've taken some great steps and implemented several automated checks which will reject bad code. We also thought of sharing them with everyone so everyone can benefit. Here's a list of things that are already implemented or are in the process of being implemented

Rate this blog entry:
Continue reading
666 Hits
0 Comments

Location tracking made easy with Google Maps APIs

Location tracking made easy with Google Maps APIs

Hey Guys,

We come across situations where locating a place becomes imperative; whether it's a venue for an event, site office or anything. Just to make sure that this  problem is overcomed, you need to add google maps support in your extensions, website and applications wherever necessary. This can be achieved with the help of certain information like the IP addess, Latitudes and Longitudes.

In this blog we are going to see how to use  Google maps APIs to show map (based on location)

 

Rate this blog entry:
Continue reading
3611 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

...
Rate this blog entry:
Continue reading
4278 Hits
0 Comments

Adding validation in Joomla for post_max_size and memory_limit

Adding validation in Joomla for post_max_size and memory_limit

Hey Guys,

In this blog we will see how to handle validation for ‘post_max_size’ and 'memory_limit' in Joomla for file uploads. Sometimes when dealing with file uploads in Joomla or in any PHP frameworks, form post size can exceed the max allowed ‘post_max_size’ (set in php.ini in your server configuration). If the size of post data exceeds post_max_size, the $_POST and $_FILES superglobals are emptied. Now, if post size validation is not added, it becomes very difficult for the end user as well as developer to track what exactly the issue is.

Using the code given below for 'post_max_size' and 'memory_limit' validation we can display the warning if post data is greater than ‘post_max_size’ or if the 'memory_limit' is exceeded in the same way as ‘com_media’ in Joomla does.

...
Rate this blog entry:
Continue reading
2933 Hits
0 Comments