Home Programming PHP Joomla component parameters configuration

Joomla component parameters configuration

E-mail Print
Share/Save/Bookmark
When you make a component you need a few parameters that can be configured - for example email, number of items shown on a page etc. This can be easily achieved with component parameters configuration that Joomla! has support for.

All we need to do is a config.xml and put it in a administration/components/com_OURCOMPONENT/

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install SYSTEM 
"http://dev.joomla.org/xml/1.5/component-install.dtd">
<root>
  <params>
    <param type="text" name="email_from" size="15" 
      label="Email sender:" description="It will be shown as FROM address" />
    <param type="text" name="confirmationMail" size="15" 
      label="Owner mail:" description="Oreder details will be sent here" />
    <param type="radio" name="sendConfirmationMail" label="Send mail?:"
      description="Do you want confirmation mail to be sent" default="0">
        <option value="0">NO</option>
        <option value="1">YES</option>
    </param>
  </params>
</root>
Then you should add a link to parameters configuration. In your view file add a menu item
JToolBarHelper::preferences( 'com_OURCOMPONENT' );
more info can be found in joomla docs

Hits: 2681
Comments (0)Add Comment

Write comment

busy
Last Updated ( Monday, 04 May 2009 21:09 )  

Sponsored Links

My friends

Bookingpoint
partner websites

Donate

Do you find content useful? Please donate so I can cover my hosting expenses! Thanks!