Hi guys,
I realise that this topic may have already been started and done with, but I still got the question and I can’t find a concrete answer.
I am trying to create a small if statement like we would do in SMARTY, but I dont know if Revolution even has PHx or something native in it’s coding.
This is what I am trying to do:
[[+phx:if`[[*id]]`:ne=`[[+id]]`then:`<div class="footer-button"><a href="[[~[[+id]]]]">Read more</a></div>`]]
Am I now completely off track or am I coming close?
/edit
I’ve started fiddling around with the If snippet from SplittingRed and it looks very promising but it doesn’t do what I expect it to do.
[[If? &subject=`[[*id]]` &operator=`==` &operand=`[[+id]]` &then=`<div class="footer-button"><a href="[[~[[+id]]]]">Read more</a></div>` &else=`woot`]]
Now, the above really should do this:
if ($subject == $operand) {
echo '<div class="footer-button"><a href="[[~[[+id]]]]">Read more</a></div>';
} else {
echo 'woot';
}
Although it does the exact opposite. I’ve got [[*id]] and [[+id]], which in the first page are 8 and 15, and in the second page are 15 and 15. Now, this would mean that the Read more button only displays when it’s not the same, but in fact, it’s the other way around. Am I doing something wrong?