Results 1 to 3 of 3

Thread: How to refer to body class?

  1. #1
    New user
    Join Date
    05-10-12.
    Posts
    1

    Default How to refer to body class?

    Hello!

    I have a template which makes me two links. I'm using changelanguage so I want to translate these also. My idea is to put the whole <ul>[/list]in an IF statement, but i don't know how to give the condition because i don't know how to refer to the body tag's class name.
    Could anyone help me?

    Code:
    <div class="<?php echo $this->class; ?> pagination block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
    
    <ul>
    <?php if ($this->previous): ?>[*]previous['title']; ?>">vissza
    <?php endif; ?>
    <?php if ($this->next): ?>[*]next['title']; ?>">tovább
    <?php endif; ?>[/list]
    
    </div>

  2. #2
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: How to refer to body class?

    this is the wrong way to do translations.

    take a look at http://www.contao.org/en/custom-conf...l#translations
    Consulenza Contao CMS https://www.intco.it

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

    Default Re: How to refer to body class?

    You don't need to refer to the <body> class. Use the {{iflng::*}} insert tag instead.

    For example:
    Code:
    {{iflng::hu}}vissza{{iflng}}{{iflng::en}}back{{iflng}}{{iflng::de}}Zurück{{iflng}}
    As already mentioned by ga.n you can also use a language variable:
    Code:
    <?php echo $GLOBALS['TL_LANG']['MSC']['previous']; ?>
    or
    Code:
    <?php echo $GLOBALS['TL_LANG']['MSC']['goBack']; ?>
    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
  •