I am using the latest version of Migx and Modx. Is there a way to use a different chunk for the "first" row and one for the "last" row with Migx, Migxdb or bloX?
Thanks
[ed. note: lchestnut last edited this post 13 years, 4 months ago.]
are you talking about a MIGX-TV (getImageList) or about MIGXdb (migxLoopCollection,bloX,rowboat)?
In most of them, there is a placeholder
you can use it like that:
[[+_first:is=`1`:then=`this is the first line`:else=`this is not the first line`]]
if you need just another class for example for the first one you can do:
<div class="firstrow_[[+_first]]">
Well at first I needed it for migx but I decided to try the migxdb which is a better fit for my clients to enter list information. I couldnt get migxLoopCollection to work so I tried bloX which works but I would like to know how to do it for migxLoopCollection and bloX. I need one class on the first item, another for the last item and a default one for all items in between.
Thank you so much. I thought I liked MigX but I really love MigXdb. It really helps me keep things simple for my clients and myself.
Hi Bruno17,
I have used MIGX-TV successfully several times, it's great, thank you. However, for the first time I need to set a different class for the first item in the list and need a few pointers to achieve this, I'm using this to create a gallery with a js fader where the first item needs opacity:1 and the other items opacity:0 .I can't find a reference to the [[+_first]] placeholder in the documentation so don't know how or where to put this to use it and need more context for the example you have given here. I get that the div goes in the Tpl chunk, but do I need two chunks here with different classes? Please excuse my ignorance but I do find this a bit confusing, I'm fine with html and css but I'm not a js or php (I know this is not js or php) coder and need some clarification on the logic and where things need to go here.
I haven't tried MIGXdb, would that be better for this purpose?
Thanks - Zaphodz
in this case you can do in your MIGX - tpl - chunk:
style="opacity:[[+_first]];"
for reverse - sortorder use