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?
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
Thanks. That works perfectly.