Mobile app version of vmapp.org
Login or Join
Pope3001725

: Joomla! 2.5 -- Adding a custom field to menu-item-edit-form 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

@Pope3001725

Posted in: #Forms #Joomla #Plugin

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.php
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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pope3001725

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gail5422790

Try changing the line:

<fields name="main">


in your XML file to:

<fields name="params">


This way the plugin system knows that it needs to add this form in the params section of the admin interface.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme