We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25218
    • 7 Posts
    Hi All,

    I am new to MODx but I am quickly loving it!

    Anyhow, I searched on this and I can’t find anything here or elsewhere.

    One reason I like MODx so much is that you seem to be able to rip any bit of data out of anywhere using placeholders here and there.

    My problem is this. I am using a bit of data recorded in a TV and that’s working just fine. I’ve bumped into a situation now where I don’t want the actual data from the TV presented but I want the descriptive data surrounding it presented.

    Example, I have a TV which is a series of options about fruits

    I call the TV like [!fruitList!]. Maybe add some params for filtering.

    I am at a point where I now want to pull the "Caption" that relates to all of these items in the TV and the TV itself

    Can I do this somehow? like [fruitList? displayCaption] or soething?

    Thanks!
    ROb
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That’s not a TV, that’s a snippet. TV tags look like this: [*tvname*]

      To get that information, though, you would need a snippet. If you are already using a snippet to process the TV’s values using an API function to get a given TV’s values, you will need to add a query to the snippet to get the caption from the TV table where the tvname is whatever your TV’s name is.
      $res = $modx->db->select("caption", $modx->getFullTableName('site_tmplvars'), "name='tvname'");
      $caption = $modx->db->getValue($res);
      

        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 25218
        • 7 Posts
        SOTTWELL!

        Thank you! Yeah, my fault on the placeholder structure.

        This is awesome!

        -Rob