Created
September 18, 2012 17:08
-
-
Save opengeek/3744346 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
I do not understand the difference why the prperty
src
is just filled with*page-image
and thealt
property needs its resource field referenced by[[*pagetitle]]
.If both cases work, then it should be possible to write it both ways? This:
is the same as that:
Is that right?
The rason why this will work is, that the resource tags can be accessed from all chunks. No matter how deep they are nested.
But it would not work if I am already in a chunk and I try to call another chunk using placeholders like that:
This would not work, would it?