We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25969
    • 118 Posts
    Hopefully not the most stupidest question but is there an easy way to have an incrementing number (1, 2, 3...) as a placeholder for each item?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It’s not a stupid question, but it is too vague. What kind of items? How long does the count need to be kept? For the session? Permanently?
        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
        • 10449
        • 956 Posts
        I’ve tried using the [+current+] placeholder in a Ditto tpl, but that didn’t return any values.

        [+item+] doesn’t work either - although when you do var_dump($modx->placeholders); in a snippet, and place that below your ditto-call, it lists each Ditto-element inside an item[] array.
        The documentation is not very helpful here... a usage example would be nice.
          • 28436
          • 242 Posts
          Hallo guys

          since the 2.1Beta use [+ditto_iteration+]

          ciao, Stefan
            • 25969
            • 118 Posts
            Quote from: stefan at Feb 20, 2008, 04:25 AM

            Hallo guys

            since the 2.1Beta use [+ditto_iteration+]

            ciao, Stefan
            Thanks man, that’s the one.

            sottwell: Yeah, I was just looking for a placeholder for an item-level ditto templete that would be replaced with a number that incremented for each item it output. Stefan had the answer. I know I could use "<ol>" to number each item output but this isn’t the case in this situation, I needed it for CSS purposes to separate each item.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I just wasn’t paying attention and didn’t notice that this is in the Ditto forum rolleyes
                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