I’m considering making the running of snippet "X" on a page dependent upon whether snippet "Y" gets called on that same page. Is there a method in revo for checking this (something to the effect of "getResourceSnippets")?
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
-
MODX Staff
- 10,725 Posts
That’s not possible. You would have to process the entire Resource in real time and log every Snippet execution. You’ll need you Snippets to use placeholders, the registry or some other way to notify the other Snippet it was executed.
Thanks for your quick reply, Jason! So the snippet I want to check for is getResources. Any advice on testing for the presence of that one in particular?
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
-
MODX Staff
- 10,725 Posts
No, you would have to write you own Snippet that set some placeholder or something that you would then check for in another Snippet. You could wrap the call to getResources in another Snippet to do that, even making it generic so you could use it to execute any Snippet with your additional notification logic.