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.