there is a way to use a diferent template for the 6th listed element with ditto? like with tplFirst, tplLast ...
Hi,
That’s an intriguing question. You could do it by having a conditional statement in the call using PHx - when a condition arises, use a different template.
What I would do is simpler - use the Doc ID to make a CSS class, and then style it. In the template I could have this bit of code:
<div class="[+id+]">...
That would give me a different class for each element. Then I make note of what class the sixth item has, and style it accordingly to make it look different. That’s not automated, of course.
I hope that gives you some ideas.
Cheers, Dave
-
MODX Staff
- 10,725 Posts
If using Revolution, you could use getResources which let’s you specify tpl’s for specific result indices, i.e. &tpl_6=`sixthItemTpl`, or you could back port the logic of getResources to an Evolution compatible Snippet to accomplish the same.
Thank all of you the answers.
For the 6th element the template is very different, adding a class can’t help me.
The phx has to go the chunck and loading from the ditto tpl a different chunks just doesnt seem to get the data ... I did with phx something like if 6n element chunk6 else chunkBasic
The Revolution thing sounds exciting, I’ll see what can I do with the idea for Evolution
-
☆ A M B ☆
- 24,524 Posts
Couldn’t you just use the [+ditto_iteration+] placeholder as part of an ID, then style the 6th one in the CSS?