Results 1 to 2 of 2

Thread: [template_override] Custom module templates

  1. #1
    User
    Join Date
    07-26-09.
    Posts
    175

    Default [template_override] Custom module templates

    Hi there

    If you ever wanted to have two newslist modules each with own layout (mod_newslist) now you can use this module http://www.contao.org/en/extension-l...000009.en.html. This extension also allows to override the content element templates!

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: [template_override] Custom module templates

    Surprised you haven't gotten any replies yet...

    Very cool extension. Something I've been wanting to have, and was about to write my own, so thanks!

    Bonus points for content elements, too. Never thought about that, but now that I have, I can see scenarios where that would be useful to have.

    One suggestion I have is to enable this for articles as well.

    Another thing -- and this is a little more complex, I know -- but it might be really cool to have some configuration options, even if its just via a configuration array. Here's what's crossed my mind in the past...

    Code:
    $GLOBALS['TL_CONFIG']['TEMPLATE_OVERRIDES'] = array  // or wherever it should go...
    (
        // Stuff not defined here work as they do now -- no restrictions or friendly names...
        'text' => array  // This is the key that's defined in the 'TL_CTE' array...
        (
            // These are template file names...
            'ce_text_something'        => 'Some Friendly Name',
            'ce_text_something_else' => 'Another Friendly Name',
            'ce_text_another_thing',
        ),
        'headline' => array()  // Don't allow template overrides
    );
    So in other words you'd specify certain CE's/modules that only allow certain templates to appear in the menu (or none at all) and be selected, and optionally a friendly name can be specified in place of the actual template name.

    I was thinking that by having restrictions and friendly names, this could potentially be useful to give clients access to. Maybe not so much for modules, but for content elements -- so they can choose between different formats when the need arises, much like how Ruud's extension allows CSS classes via a select menu.

    What do you think? Dumb idea?
    Brian

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
  •