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.

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Brad Markle, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. After attempting to change the base URL, I now cannot login to the back office.
  2. What is the problem with an email form when receiving a white page?
  3. Google Analytics in Joomla 2.5

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!