I have created a custom field in Joomla 1.5 menu for description of the menu. I have edited the component.xml in administrator\components\com_menus\models\metadata
but now I want to put a text editor in place of a normal text-box. Any ideas how to approach this?
Asked
Active
Viewed 459 times
0
1 Answers
0
You need to create an element of editor type.
Learn how to create element and how to save data
class JElementMyeditor extends JElement
{
var $_name = 'Myeditor';
/**
* @param $name
* @param $value
* @param $node
* @param $control_name
*/
function fetchElement($name, $value, &$node, $control_name)
{
$editor = JFactory::getEditor();
$width = $node->attributes('width');
$height = $node->attributes('height');
$col = $node->attributes('col');
$row = $node->attributes('row');
// ($name, $html, $width, $height, $col, $row, $buttons = true, $params = array())
return $editor->display($control_name.'['.$name.']',
htmlspecialchars($value, ENT_QUOTES),
$width, $height, $col, $row,
array('pagebreak', 'readmore') ) ;
}
}
And you can use this in xml as
<param name="custom_param"
width="300"
height="150"
type="myeditor"
label="LABEL"
description="DESC"
/>

Gaurav
- 28,447
- 8
- 50
- 80
-
Sorry i didn't explain it correctly i have added the a extra field in Parameters (System) of each menu item this is the code `` I want a text editor for this is there a way i have searched but didnt get anything – swap Jan 18 '12 at 10:09