Results 1 to 5 of 5

Thread: Tree view, parent edit icon

  1. #1
    User
    Join Date
    08-10-09.
    Posts
    31

    Default 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.



    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?
    Jaap Jansma

    Walk Wise Webdesign

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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.

  3. #3
    User
    Join Date
    08-10-09.
    Posts
    31

    Default 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.
    Jaap Jansma

    Walk Wise Webdesign

  4. #4
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default 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.

  5. #5
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default 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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •