Question

I checked out this article Creating a simple module/Developing a Basic Module for building a basic Joomla module. I understood the MVC architecture and file structure they've mentioned there. It is a simple Hello World module for Joomla.

Now I want to modify this module in a way that it accepts whatever text I enter (instead of static "Hello World") from Joomla back-end. What I don't get is, how to or where to enter the code for the text-box field that gets displayed in Joomla back-end of this module?

In short, the link above doesn't mention anything about entering back-end parameters for a module. How to do that?

Was it helpful?

Solution

You define parameters in the XML file like so:

<config>
    <fields name="params">
        <fieldset name="basic">
            <field name="param1" type="text" default="" label="" description="">
            <field name="param2" type="text" default="" label="" description="">
            <field name="param3" type="text" default="" label="" description="">
            // add more here
        </fieldset>
    </fields>
</config>

And you can call them like so:

echo $params->get('param1');
echo $params->get('param2');
// and so on

Hope this helps

OTHER TIPS

Try this,

Inside your module config xml you have to add your module params like below.

<config>
<fields name="params">
<fieldset name="basic">
<field name="face_book_link" type="text" default="" label="Face Book Link " description="Face Book Link" size="60"/>
<field name="face_book_link_yes" type="radio" default="1" label="DisplayFB Link" description="DisplayFB Link">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
</fieldset>
</fields>
</config>

a detailed module development tutorial

Hope its helps..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top