Tree view, parent edit icon
Hi,
I have a problem. I made a tree view with category and a child module. I can get an edit button for the module. But I want an edit button for category. See screenshot, where the edit button is missing.
http://www.contao-community.org/down...ile.php?id=267
The module is a type tl_module_prototype and the category is a tl_module_category. And this is the DCA for tl_module_prototype
Code:
$GLOBALS['TL_DCA']['tl_module_prototype'] = array
(
'config' => array (
'dataContainer' => 'table',
'ptable' => 'tl_module_category',
),
'list' => array (
'sorting' => array (
'mode' => 6,
'fields' => array('title'),
),
'label' => array (
'fields' => array ('title'),
'format' => "%s",
),
'global_operations' => array (
),
'operations' => array (
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_module_prototype']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_module_prototype']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"',
),
),
),
);
How can I add an edit button to the category?
Re: Tree view, parent edit icon
Did you suss this Grapio?
I've never used tree view but I'd suspect "site structure" would be the one to look at.
Re: Tree view, parent edit icon
No I could not figure out how it should work. I looked at sitestructure. But site structure contains parent of the same type. I also took a look at the articles but that did work somehow. But I could not add edit and delete buttons to the parent.
Re: Tree view, parent edit icon
I don't think this is possible with the core DC_Table driver. You can only edit one table at a given time even in all the different modes without a callback. 2.9 opens it up to more than just a single parent-child relationship, but even still, you'd need a different driver to do what you are looking for.
Re: Tree view, parent edit icon
You can only control edit button on the table you're editing. You can't edit a parent and child in one view. You can setup the parent view can display the parent item with a labelcallback. You it shows the site structure page icon in the articles view, but you won't find edit controls. You can make an icons next to the child item to edit the parent, then you have to redirect it to the edit view for the parent view. This would be the inverse of the site structure's article edit button.