Results 1 to 3 of 3

Thread: Get the ID of a module in a template

  1. #1
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Get the ID of a module in a template

    Hello,

    I would like to use the ID of a module within the template to compose IDs tags. How could I get it?

    For example in the mod_navigation module I can get $this->id. but I can´t get it from nav_default template. How could I get it or pass it ?

    Thank's
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  2. #2
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: Get the ID of a module in a template

    I'm not sure if you can get an ID from the navigation sub-templates like nav_default.html5. It depends if the navigation module passes the ID to the template.

    The best thing to do is put this line at the top of your template:
    Code:
    <?php $this->showTemplateVars(); ?>
    That will show you every variable that is set for that template, see if there's anything in there you can use.

  3. #3
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: Get the ID of a module in a template

    I didn't know this...

    I've got some unique ID

    Thanks
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

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
  •