When working with Joomla 2.5 plugins, you may have noticed that some of the parameters are divided into separate parameter types, such as Basic Options and Advanced Options. If you're writing your own Joomla 2.5 plugin, you can do this separation by adding parameters to different fieldsets.

Fieldset Names

Here is our helloworld's xml file thus far:

<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="content">
        <name>Hello World</name>
        <author>Brad Markle</author>
        <creationDate>June 18th, 2012</creationDate>
        <copyright>InMotion Hosting</copyright>
        <license>GNU General Public License</license>
        <authorEmail>bradm@inmotionhosting.com</authorEmail>
        <authorUrl>http://www.inmotionhosting.com</authorUrl>
        <version>1.0</version>
        <description>This is my very first plugin! Simple Hello World Plugin that prints "Hello World" at the beginning of every article.</description>
        <files>
                <filename plugin="helloworld">helloworld.php</filename>
                <filename>index.html</filename>
        </files>
        <config>
                <fields name="params">
                        <fieldset name="basic">
                                <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." />
                        </fieldset>
                        <fieldset name="more">
                                <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>
                                </field>
                                <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>
                                </field>
                        </fieldset>
                </fields>
        </config>
</extension>

As you can see in the code we have two fieldsets, one named basic and one named more. You can see in the screenshot below how this separates the parameters:

fieldset-names

Fieldset Language definitions

You may have noticed from the screenshot that even though we set the second fieldset with a name of "more", it shows as COM_PLUGINS_more_FIELDSET_LABEL. This is because by default there are only a certain set of names that you can use for fieldsets. These names are defined in the following file:

administrator/language/en-GB/en-GB.com_plugins.ini

When looking at en-GB.com_plugins.ini, you can see the following fieldset names are defined:

COM_PLUGINS_ADVANCED_FIELDSET_LABEL="Advanced Options"
COM_PLUGINS_BASIC_FIELDSET_LABEL="Basic Options"

If you want to label either of your fieldsets as "Basic Options" or "Advanced Options", you must set the fieldset name to either basic or advanced.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

Need more Help?

Search

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: support@InMotionHosting.com
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!