[SOLVED] Swap Content Layout in a Loop Using Smarty
Posted: Fri Jan 08, 2016 6:20 am
Hi I need to show the content of the News Module in an odd/even order. I've tried using {cycle} and {section} but I'm not a programmer so I'm just guessing here. Here's an example of what I'm trying to accomplish:

The sample code for each layout is something like this:
I have several news and they should be presented like this:
1. Layout A
2. Layout B
3. Layout A
4. Layout B
5. And so on...
Is this possible using smarty?
Thanks in advance for any help on this.

The sample code for each layout is something like this:
Code: Select all
<!-- Layout A -->
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8 text-center">
<div class="image">
Image
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 text-center">
<div class="text">
Text Content
</div>
</div>
</div>
<!-- Layout B -->
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 text-center">
<div class="text">
Text Content
</div>
</div>
<div class="col-lg-8 col-md-8 col-sm-8 text-center">
<div class="image">
Image
</div>
</div>
</div>1. Layout A
2. Layout B
3. Layout A
4. Layout B
5. And so on...
Is this possible using smarty?
Thanks in advance for any help on this.