We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49312
    • 61 Posts
    I'm looking to break up every 5 images that our outputted by MIGX into separate divs.

    Example:

    <div>
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    </div>
    <div>
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    <img src="" alt="" />
    </div>

    Looking at various templates and placeholders it looks as if this might be doable out of the box but I can't quite wrap my head around how to do.

    Thanks,
    Steve
      • 4172
      • 5,888 Posts
      I think this should work:
      &tpl
      <img src="" alt="" /> 
      


      &tpl_n5
      <img src="" alt="" />
      [[+_last:isnot=`1`:then=`
      </div>
      <div>
      `:else=``]]
      


      &wrapperTpl
      <div>
      [[+output]]
      </div>


      or with an additional tplLast

      &tpl
      <img src="" alt="" /> 
      


      &tpl_n5
      <img src="" alt="" />
      </div>
      <div>
      


      &wrapperTpl
      <div>
      [[+output]]
      </div>


      &tplLast
      <img src="" alt="" />
      



      [ed. note: Bruno17 last edited this post 11 years, 3 months ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!