We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27733
    • 99 Posts
    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.
      • 22303 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.
        • 27733
        • 99 Posts
        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.
          • 22303 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.