Hi everybody
Although already discussed earlier in
http://modxcms.com/forums/index.php/topic,10151.msg69493.html#msg69493, I´d like to post the following issue again: I want to display the dynamically generated results of a Ditto call in two columns given by the page template, depending on the id (even/odd). Currently I have two approaches:
Alternative 1:
Decision about the position (left/right col) in the page template
<div id="left_col">
[+phx:if=`document id is odd`:then=`[!Ditto? etc.!]`:else=``+]
</div>
<div id="right_col">
[+phx:if=`document id is even`:then=`[!Ditto? etc.!]`:else=``+]
</div>
A fixed order of the results like in
http://www.modxcms.de/forum/comments.php?DiscussionID=237 (German) is not feasible in this case because the output is depending on various filter criteria.
Here, I could need an idea how I can check the id of the selected documents if they are even or odd. IMO this is only possible within the Ditto call, because otherwise, for example with...
<?php
$id=$_GET['id'];
etc.
?>
...I will only get the id of the current document.
Alternative 2:
Decision about the output within the Ditto template, whereas the position of the result is selected via the PHx-Modifier phx:leftright:
a) Snippet
<?php
$leftright=$output % 2;
return $leftright;
?>
b)Template left column
[+ditto_iteration:leftright:is=`0`:then=``:else=`
<div id="address">
<p>Result</p>
</div>`+]
c)Template right column
[+ditto_iteration:leftright:is=`0`:then=`
<div id="address">
<p>Result</p>
</div>`:else=``+]
... as in Marcs suggestion in
http://www.modxcms.de/forum/comments.php?DiscussionID=755 (also German)
Unfortunately, I do not get any results, i.e. an empty result page regardless of my filter criteria. Ditto 2.1.b3 is installed.
Any suggestions?
Thanks & regards!