Joomla 2.5 -- Adding a custom field to menu-item-edit-form

Posted by philipp on Pro Webmasters See other posts from Pro Webmasters or by philipp
Published on 2012-08-15T07:01:23Z Indexed on 2012/09/16 3:53 UTC
Read the original article Hit count: 228

Filed under:
|
|

I would like to add a new Field (Select list of all menu-items) to the menu item-edit form. To do so I was setting up an system plugin with the following directory structure:

languageroot/languageroot.php

languageroot/form/form.xml

As you can see in the posted code, that is all very basic to try out.

Only after adding the following lines:

    <li>
    <?php echo $this->form->getLabel( 'langroot-text', 'main' )?>
    <?php echo $this->form->getInput('langroot-text', 'main' ); ?>
    </li>

to: /admininstrator/components/com_menus/views/item/tmpl/edit.php

a textfield shows up.

Is it possible to inject the field without touching the edit.php? Is there anywhere a good tutorial about the JForm api? Is a system-plugin the right kind, or could it be a content plugin, or should it even be a component?

© Pro Webmasters or respective owner

Related posts about joomla

Related posts about forms