doesn’t work with [! !] "uncached" call.
doesn’t work when its called [[ ]]
Turn the caching option off for the page and your snippet will work using [[ ]] and placeholders will not be cached by the first access to the snippet.
Heya, I spent a damn day to figure out that $modx->setPlaceholder(’name’, "value"); doesn’t work with [! !] "uncached" call.
Thing is, my snippet just doesn’t work when its called [[ ]].
Any ways to fix the problem / walk-around?
Thanks in advance.
Sorry for not being clear, I’m forced to use [! !] because my snippet gets some parameters out of $_GET, but setPlaceholder() won’t work with [! !]. I’ve made a walkaround (better said, a dirty hack): my snippet gets called 4 times on a page -- all with different parameters -- and it acts pretty much like a placeholder.
OK, do you mean :-
The other option is to make sure all your placeholders appear within content that is not getting cached (i.e. returned by a snippet called via API or with non-cacheable tags, [! !]. But I use dynamic pages without caching all the time, because some pages simply do not make sense to cache at all. And being able to put placeholders anywhere in these layouts is much more convenient for my designers than the milliseconds you might save by using partial page caching on pages that are bottle-necked by the non-cacheable scripts being executed anyway.
Sorry for not being clear, I’m forced to use [! !] because my snippet gets some parameters out of $_GET, but setPlaceholder() won’t work with [! !]. I’ve made a walkaround (better said, a dirty hack): my snippet gets called 4 times on a page -- all with different parameters -- and it acts pretty much like a placeholder.
Turning caching off is of course a solution, but not rly perfect