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
-
☆ 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);
SOTTWELL!
Thank you! Yeah, my fault on the placeholder structure.
This is awesome!
-Rob