We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40643
    • 36 Posts
    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.]
      • 4172
      • 5,888 Posts
      are you talking about a MIGX-TV (getImageList) or about MIGXdb (migxLoopCollection,bloX,rowboat)?

      In most of them, there is a placeholder
      [[+_first]]


      [[+_last]]


      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]]">
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40643
        • 36 Posts
        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.
          • 33379
          • 110 Posts
          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
            • 4172
            • 5,888 Posts
            in this case you can do in your MIGX - tpl - chunk:

            style="opacity:[[+_first]];"
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 33379
              • 110 Posts
              Thanks Bruno17,

              Am experimenting with this now smiley

              Is there a way to set the sort order in the output, i.e something like &sortdir=`DESC`, to reverse the display order of the list items?

              Thanks - Zaphodx
                • 4172
                • 5,888 Posts
                for reverse - sortorder use

                &reverse=`1`
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!