We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16059
    • 22 Posts
    I have an event template. This event template has some TV’s, an relevent for my question, a checkbox TV (event_sponsors) where you can select sponsors for a particular event.

    Input Options Values;

    @SELECT pagetitle, id FROM modx_site_content WHERE parent=32


    This is generating a list of sponsors I made under the parent with ID 32. The values which are saved comma delimited, so when I have selected sponsor 1 and sponsor 4, the output will be 1,4. The sponsor resources (under ID 32) have two TV’s, sponsor_url and sponsor_image.

    How can I show the selected sponsors on a event page? In other words, how can I match the comma delimited list of sponsors (event_sponsors) with the list of sponsors and show their TV values?

    The sponsor chunk is containing something like this;

    <a href="[[+tv.sponsor_url]]"><img src="[[+tv.sponsor_image]]" /></a>
      • 33968
      • 863 Posts
      Hi, you could simply include a getResources call in your event page template. Something like:
      [[getResources? &resources=`[[*event_sponsors]]` &tpl=`sponsor_chunk` &includeTVs=`1` &processTVs=`1`]]
      

      Where sponsor_chunk is the chunk you mentioned above.
        • 16059
        • 22 Posts
        Thanks! It did the job.