Have you tried turning the document to not be cached? Or have you tried using cached tags with the snippet [[ ]] rather than [! !].
Snippets within snippets need to use alternate syntax:
[[Ditto? &myParam=`[!anotherSnippetHere!]`]] or
[!Ditto? &myParam=`[[anotherSnippetHere]]`!]
I was trying to call GetField from within Ditto but for some reason Ditto was not getting the returned field values.
Here’s the problematic call:
[[Ditto?&documents=`[!GetField?&docid=`2`&field=`featuredNews`!]` &depth=`0`&dateSource=`timeStamp` &tpl=`@FILE:assets/arc_chunks/article_summary_news.chk`&display=`2`&sortBy=`timeStamp`]]
Ditto is called cached and GetField uncached. Interestingly [!GetField?&docid=`2`&field=`featuredNews`!] by itself worked just fine.
Then i switched the call types to Ditto uncached and GetField cached and it worked.
[!Ditto?&documents=`[[GetField?&docid=`2`&field=`featuredNews`]]` &depth=`0`&dateSource=`timeStamp` &tpl=`@FILE:assets/arc_chunks/article_summary_news.chk`&display=`2`&sortBy=`timeStamp`!]
I can’t think of why that would be though, but that’s how it worked for me. I’m on MODx 0.9.6.2 / PHP5 / MySQL 5
Hope this helps.
-
☆ A M B ☆
- 24,524 Posts
That order of snippets cannot work. The cached Ditto call is being processed, but the uncached GetField snippet is not being processed. A cached snippet is processed right away, and any other snippet calls inside of it will not have been processed so their values will not be available to the first snippet. An uncached snippet is not processed in that pass of the parser; its tags are converted from [!...!] to [[...]] and it is skipped.
When nesting snippets, the first snippet must be uncached, so that it is not processed during this pass of the parser, while the inner snippet is cached, so it is processed. Then in the next pass, the outer snippet is processed with the output of the inner snippet in the parameter.
Quote from: sottwell at Sep 01, 2009, 11:29 PM
When nesting snippets, the first snippet must be uncached, so that it is not processed during this pass of the parser, while the inner snippet is cached, so it is processed. Then in the next pass, the outer snippet is processed with the output of the inner snippet in the parameter.
Have you tested this in Revolution? I’m wondering if it’s still true.
-
☆ A M B ☆
- 24,524 Posts
If this is Revolution, then the inner snippet should be [[...]] as well. Seeing the uncached snippet call, I just presumed this was Evolution.
Quote from: sottwell at Sep 02, 2009, 04:41 AM
If this is Revolution, then the inner snippet should be [[...]] as well. Seeing the uncached snippet call, I just presumed this was Evolution.
I think it is Evolution the OP is talking about.
I was just reminded that I meant to ask if you’ve tested the nested snippet caching in Revolution yet.