InMotion Hosting Support Center

Joomla 2.5 has reached its end of life as for 12/31/2014. Please be advised this may be a security risk to your website. You can view more information about the end of life here.

When adding parameters to Joomla 2.5 plugins, there are various input types you can use. In our testing thus far, we have only used the text input type. In this Joomla 2.5 tutorial, we'll cover some of the various other plugin parameter types that you can use.


Radio type plugin parameters


Example Code:

<field name="color" type="radio" default="black" description="Which color should the message be displayed in?" label="Color">
    <option value="black">black</option>
    <option value="red">red</option>
    <option value="blue">blue</option>

The code to add a radio button as a plugin parameter is very similar to the standard code for using radio buttons in HTML.

Accessing the value of a radio button within your plugin's php file is similar to getting the value of a standard text type field. As our field's name above is color, we'll get the value of the user's color using that name, as in:



List type plugin parameters


A list parameter refers to a drop down list. In our hello world plugin, we added the following list to allow users to choose what font size they would like the message displayed using.

Example Code:

<field name="font-size" type="list" default="12" description="What size font should the message use?" label="Font size">
    <option value="8">8px</option>
    <option value="12">12px</option>
    <option value="16">16px</option>

Again, accessing the parameter value itself is done in the same manner:



Text parameter input type


To make this a well rounded tutorial, we'll also include the text input type (even though we referenced it in a previous article).

Example Code:

<field name="alt-text" type="text" default="" label="Alternative Text" description="Besides Hello World, you can specify other text here to print to the screen instead." />

To access this value, again use the following code in your plugin's php file:


Continued Education in Course 215: Joomla 2.5 Content Plugin Development
You are viewing Section 7: Basic parameter types in a Joomla 2.5 plugin
Section 6: Where is Joomla 2.5 plugin information stored?
Section 8: Using fieldsets to separate plugin paramenters in Joomla 2.5
n/a Points
2014-06-25 5:06 am


Please tell how to update the php file with this code of  the radio type parameters and list type parameters.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

1 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!