Results 1 to 10 of 10

Thread: Hide types of content elements from User groups

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Hide types of content elements from User groups

    Is there a possibility to select what's available for user groups in the Elements type drop-down? I would like to hide some of them to make it easier for editors by showing them only the few they will use.

    Many thanks

  2. #2
    New user
    Join Date
    06-04-09.
    Posts
    22

    Default Re: Hide types of content elements from User groups

    When you set up a user group in TL, you can define "tl_content" under Allowed fields. This determines what article elements are available to the user.

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Hide types of content elements from User groups

    Thanks for your reply, Clemens. However, this is not what I've asked about.

    I want to limit the items available in the 'Elements type' drop-down. Lots of them are just not relevant to regular editors.

  4. #4
    New user
    Join Date
    06-04-09.
    Posts
    22

    Default Re: Hide types of content elements from User groups

    Hi spirelli,
    Sorry, i misunderstood. Try editing the dcaconfig.php file.

    Code:
    if (!$this->User->isAdmin)
    {
     *  unset($GLOBALS['TL_CTE']['images']['gallery']);
    }
    This deactivates the "gallery" element for non-admin users.

    C.

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Hide types of content elements from User groups

    Just had time to look at this now...
    The sample above works perfectly.
    I've tried the same thing with
    Code:
       unset($GLOBALS['TL_CTE']['images']['image']);
    and that works as expected.

    However, I can't figure out any of the other correct variables. I've tried guessing, and ['files']['downloads'] works as well, but is there anywhere where I can look up what the others are? I've tried looking through the files for the backend module, but I'm a bit lost. Thanks for any help.

  6. #6
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: Hide types of content elements from User groups

    Temporarily add print_r($GLOBALS['TL_CTE']); to the dcaconfig.php to see the complete list.

  7. #7
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Hide types of content elements from User groups

    Thanks a lot. That's helped
    Would be great if one day that could be done in user group settings.

  8. #8
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Hide types of content elements from User groups

    ACTUALLY,

    It does what I've intended in the backend, but it breaks my site. The layout is jumbled up, and the Log shows a list of errors:
    [06/07/2009 17:38] Content element class "" (content element "html") does not exist … Delete Show details
    [06/07/2009 17:38] Content element class "" (content element "module") does not exist … Delete Show details
    [06/07/2009 17:38] Content element class "" (content element "article") does not exist … Delete Show details
    [06/07/2009 17:38] Content element class "" (content element "module") does not exist …
    and so on.

    It seems as if it doen't like it if the hidden element is used on the page. It seems as if the suggested solution doesn't really work. Just in case, this is what I've inserted into the dcaconfig.php file:

    Code:
    if (!$this->User->isAdmin)
    {
       unset($GLOBALS['TL_CTE']['texts']['code']);
       unset($GLOBALS['TL_CTE']['texts']['list']);
       unset($GLOBALS['TL_CTE']['texts']['html']);
       unset($GLOBALS['TL_CTE']['links']['toplink']);
       unset($GLOBALS['TL_CTE']['includes']['article']);
       unset($GLOBALS['TL_CTE']['includes']['alias']);
       unset($GLOBALS['TL_CTE']['includes']['form']);
       unset($GLOBALS['TL_CTE']['includes']['module']);
       unset($GLOBALS['TL_CTE']['includes']['teaser']);
    
    }

  9. #9
    Official Contao Team
    Join Date
    06-10-09.
    Location
    Stuttgart, Germany
    Posts
    68

    Default Re: Hide types of content elements from User groups

    Hi spirelli,

    there is also an extension called "ce-access" from andreas which enables you to select or deselect content elements for user groups.
    Updated today for TL 2.7.2 use.
    ---------------------------------------------------
    kind regards planepix

    Official Contao team member - Official Contao partner
    workshop contao conference site 2011
    workshop contao conference site 2012

  10. #10
    User
    Join Date
    06-19-09.
    Posts
    106

    Default Re: Hide types of content elements from User groups

    Thanks, I'll give this a try.

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
  •