views:

11

answers:

1

I'm currently working on a custom joomla component but I fail to get the component wide parameters to work.

The joomla docs say that if you add

to your 'myComponent.xml' file, the parameter should appear in the _components table. I do see my component but there are no params there.

Is there anything I should know? Or anything I might do wrong?

here is test.xml { myComponent.xml }:

<?xml version="1.0" encoding="UTF-8"?>
<install type="component" version="1.5.0">
    <name>test</name>
    <creationDate>2010-08-05</creationDate>
    <author>test</author>
    <version>1.0.0</version>
    <description>test</description>

    <administration>
        <menu>Ctest</menu>

        <files folder="admin">
            <filename>controller.php</filename>
            <filename>test.php</filename>
            <filename>index.html</filename>
            <filename>models/test.php</filename>
            <filename>models/index.html</filename>
            <filename>views/index.html</filename>
            <filename>views/test/index.html</filename>
            <filename>views/test/view.html.php</filename>
            <filename>views/test/tmpl/default.php</filename>
            <filename>views/test/tmpl/index.html</filename>
        </files>

    </administration>

    <params>
        <param name="test" type="text" default="" label="test" description="test" />
    </params>
</install>
A: 

Make sure you're configuring the params correctly in both places config is needed.

In COMPONENTNAME.xml, you need the block you've got above (although I think only 'name' and 'default' are used here).

Also, in admin/config.xml, you'll need something like:

<root>
    <params>
        <param type="text" name="test" size="30" label="test" description="test" />
    </params>
</root>

You'll then need to make sure there's a way to get to these config options, with this in your 'toolbar.COMPONENTNAME.html.php':

JToolBarHelper::preferences('com_magentocatalogue');

Then, a 'config' button should appear in the toolbar for your component. Only once you save some changes will these parameters appear in the #__components.params field.

KingJackaL