We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2060
    • 6 Posts
    Currently I’m using 3 snippets in a template to output 3 pieces of data from a single db table record. However this means that I need to make 3 queries to the same record, one in each snippet, to get the data.

    Is there a way to use two chunks and a snippet to do this. Namely, could the snippet make one call to the db to fetch the record, then set the content of the two chunks?
      • 13735
      • 62 Posts
      Hello,

      you sould take a look at $MODx->setPlaceholder(’placeholderName’, ’content’);. Call this within your snippet. To access them first call the snippet and then you can use the placeholders with [+placeholdername+] as always.

      regards
      JB
        • 2060
        • 6 Posts
        Thanks. That works perfectly.