We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1634
    • 51 Posts
    Hi,

    I have a ditto call outputting something like this:

    Project01
    Project02
    Project03
    Project04
    Project05
    Project06
    Project07
    Project08

    ... and so on upto 25.

    I want them to appear grouped as follows:

    <b>Manager1</b>
    Project01
    Project02
    Project03
    <b>Manager2</b>
    Project04
    Project05
    <b>Manager3</b>
    Project06
    Project07
    Project08

    I’d describe this as a groupby clause. Does anyone know how I might do this, baring in mind that I want to output the top 25 records. I could do something with css but that would be very clunky.

    Oh, by the way, the groupBy is a tv value.

    Hope you can help, thanks in advance for your time.

    AndyFlan
      Hmmmmm.

      It&#39;s all a delusion
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You probably need separate Ditto calls for each group, using a different filter for each one.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 1634
        • 51 Posts
        Hi, yes, I’d thought that through but the problem is that I need the top 25 records regardless of what group they fall into. That’s why I liken it to GROUPBY, as in groupby sql statement. So another way of saying it is that the notional grouping occurs after the data has been selected.
          Hmmmmm.

          It&#39;s all a delusion
          • 1634
          • 51 Posts
          Just to inform. I’ve now respecified this functionality with the client and no longer need to support what I’ve outlined in this thread. Its not just because of the difficulty I was having with grouping, there are other issues. Thanks anyway.
            Hmmmmm.

            It&#39;s all a delusion