We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36786 ☆ A M B ☆
    • 209 Posts
    I'm trying to institute a parameter similar to &tplOdd in getResources for in getImageList.

    I figured I could do a conditional within the &tpl chunk to check if the idx number was even or odd, but I can't figure out a way to do so. What I came up with is below:

    [[+idx:isOdd=`0`:then=`<div class="row">`]]


    <?php
    $number = $input;
    $odd = 1;
    $even = 0;
    
    if( $number = $number%2 ) {
      return $odd;
    }
    else {
      return $even;
    }

    This question has been answered by Bruno17. See the first response.

    [ed. note: maroonlover last edited this post 12 years, 7 months ago.]
      Ben Morrison
      Hacking templates to pieces since 2003
    • discuss.answer
      • 4172
      • 5,888 Posts
      you can either use the property

      &tpl_n2=`everySecondTpl`


      or the placeholder

      [[+_alt:is=`1`:then=``:else=``]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 36830
        • 140 Posts
        any equivalent for tplLast?
          • 4172
          • 5,888 Posts
          Quote from: pjldesign at Sep 29, 2015, 07:54 PM
          any equivalent for tplLast?

          yes, its
          &tplLast
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!