Webeks.net - freelance programming
freelance programming - php, Joomla, Zend ...
Home :: Articles :: Programming :: Joomla! :: Joomla component parameters configuration

Joomla component parameters configuration

Written by Miha

 

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! 1.5 has support for.

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

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE install SYSTEM
  3. "http://dev.joomla.org/xml/1.5/component-install.dtd">
  4. <root>
  5. <params>
  6. <param type="text" name="email_from" size="15"
  7. label="Email sender:" description="It will be shown as FROM address" />
  8. <param type="text" name="confirmationMail" size="15"
  9. label="Owner mail:" description="Oreder details will be sent here" />
  10. <param type="radio" name="sendConfirmationMail" label="Send mail?:"
  11. description="Do you want confirmation mail to be sent" default="0">
  12. <option value="0">NO</option>
  13. <option value="1">YES</option>
  14. </param>
  15. </params>
  16. </root>

Then you should add a link to parameters configuration. In your view file add a menu item

  1. JToolBarHelper::preferences( 'com_OURCOMPONENT' );

more info can be found in joomla docs

 


blog comments powered by Disqus