Results 1 to 8 of 8

Thread: Can I assign different template to the same element?

  1. #1
    New user
    Join Date
    04-30-11.
    Posts
    24

    Default Can I assign different template to the same element?

    Forgive me if I misunderstand this.

    For example, if I add an "Image" to my page, I can replace it's template by creating a ce_image.tpl. Is there a way I can create multiple templates for "Image" and be able to choose them as I want? For example if I am to add
    ce_image_2.tpl
    ce_image_3.tpl
    And I want to be able to use them in the same page? Is this possible?

  2. #2
    User PaoloB's Avatar
    Join Date
    06-19-09.
    Location
    Italy
    Posts
    238

    Default Re: Can I assign different template to the same element?

    Many elements include the choice of the template, but not all.
    For images you can not select a different template
    Paolo B.
    Contao ambassador
    ContaoCms.it - Sito di riferimento per la comunità italiana

  3. #3

    Default Re: Can I assign different template to the same element?

    one thing you can do is give this content element a class and you can get this class inside template variable. Depending upon the class, branch your code in the same template. This is i do most of the time.
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

  4. #4
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Can I assign different template to the same element?

    If you can give us some information on what is the end-result you wish to accomplish, maybe we can think of an easier route to get to your destination.

  5. #5
    New user
    Join Date
    04-30-11.
    Posts
    24

    Default Re: Can I assign different template to the same element?

    Hi mechaflash. I was trying to set up the "image" elements for my client to feed into jquery's rotate banner script. It can be done as is but I wanted to remove some of the divs I don't need just so the code's lighter and cleaner.

    I actually got it done by duplicating the "image" module and tinker with it into a new module :D

  6. #6
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Can I assign different template to the same element?

    don't forget you can always do a custom html module (Module Type: Miscellaneous -> Custom HTML) and inserting your code. If you don't specify a <div> it will not have a <div> XD.

  7. #7
    New user
    Join Date
    06-18-12.
    Posts
    6

    Default Re: Can I assign different template to the same element?

    I want to assign different template for front end modules and layouts,But I don't know how to do this?

    If anyone know than please reply me.

  8. #8
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: Can I assign different template to the same element?

    Contao Community Moderator
    → Support options

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
  •