There is also IF snippet for revo which can be used for phx like stuff. Check that out.
Thanks for pointing me to this snippet. However, I still can’t see how this could replace the above PHx statement. And what about conditionals with nested statements?
I am a little bit afraid right now MODx Revolution might not provide the same degree of flexibility than MODx Evolution. Is this really the case or is there a way to get the same functionality in MODx Revolution that PHx currently provides in MODx Evolution?
-
MODX Staff
- 2,502 Posts
The If Snippet for conditionals will do the same thing as you’ve posted as follows:
[[If? &subject=`[[*id]]` &operator=`equals` &operand=`1` &then=`[[$bg_image-slider]]` &else=`[[$bg_image-default]]`]]
Snippets in Revo can be nested and filters can be used as well. PHx has some hard limitations as its ability for nesting and output volume. The If snippet is not necessarily a wholesale replacement but it works in most cases for such conditionals.
If you are going to use significantly complex PHx statements it is likely that you should be writing a custom snippet as it will be likely more efficient than using the parser to do all the heavy lifting.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
MODX Staff
- 2,502 Posts
Quote from: Bytesource at Dec 22, 2009, 02:55 AM
I am a little bit afraid right now MODx Revolution might not provide the same degree of flexibility than MODx Evolution. Is this really the case or is there a way to get the same functionality in MODx Revolution that PHx currently provides in MODx Evolution?
MODx Revolution has so much more flexibility than Evo it is not even possible to describe sensibly in a response. I think the problem lies in that there are new ways to do things we are used to.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
Thanks for the code example! The If snippet really seems to be able to replace PHx in most cases.
-
☆ A M B ☆
- 3,112 Posts
Damn...
Everything is getting more complex in Revo.
You guys make me feel so dumb.

Will there any Freeze Dev Time so the documentation can take the top priority?
Revo’s guide for a noob?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.