-
-
Save pepebe/3813594 to your computer and use it in GitHub Desktop.
Example of optimizing conditional filters using a Chunk wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[[[*page-image:notempty=`$wrapImgThumb? | |
&src=`*page-image` | |
&alt=`[[*pagetitle]]` | |
&thumbOpts=`w=480&h=320` | |
`]]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[*page-image:notempty=` | |
<img | |
src="[[*page-image:phpthumbof=`w=480h=320`]]" | |
alt="[[*pagetitle]]" | |
/> | |
`]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="[[[[+src]]:phpthumbof=`[[+thumbOpts]]`]]" alt="[[+alt]]" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Technique proposed by Jason Coward
Use this technique to prevent MODX from parsing all tags in a conditional.
For further understanding read this: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/