We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23491 ☆ A M B ☆
    • 1,056 Posts
    I need to be able to reference the ?start= parameter from the calling page with [!Ditto!] on the actual linked article page. This way, I can link back to the correct paginated-page.

    However, when I reference [+start+] in my template, the value is always 1 higher.

    Checking the Ditto class include file revealed that, per Line 932, its PlaceHolder value purposefully incremented (for a use unknown to me)
    <?php // for highlighting
    		$modx->setPlaceholder($dittoID."start", $start +1);
    


    In the meantime, I’ve had to hack Ditto core to be able to reference the original start via placeholder [+orig_start+]

    <?php // for highlighting
    		$modx->setPlaceholder($dittoID."orig_start", $start ); // by pixelchutes
    


    Am I missing something? Is there an easier way to use [+start+] in my TPL, without having it be +1?
    When I tried using PHx [+start:math=`?-1`+], the result was as desired (except when 0), however it broke pagination altogether. Ideally, I don’t want to have to install PHx just use it’s Math calc to minus 1.

      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 18397
      • 3,250 Posts
      The start placeholder is incremented by one because like most counters in PHP it starts at 0 but it makes sense to see things like "Showing 1-5 of 5" not 0-5. I’ve added a new placeholder urlStart in the SVN version for situations like yours.
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Quote from: Mark at Mar 18, 2007, 12:09 AM

        The start placeholder is incremented by one because like most counters in PHP it starts at 0 but it makes sense to see things like "Showing 1-5 of 5" not 0-5. I’ve added a new placeholder urlStart in the SVN version for situations like yours.

        Gracias wink
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.