Wednesday, October 20, 2010

Modx 2 processed tv to display

Previously ive talked about using "input options value" to output list of keys and values for dropdown list or options.
example: "@select listlabel, listvalue from modx_listvalues where listkey='postcategory' order by weight asc, listlabel asc, id asc"

But to output the value, its not the same.

if you installed getResourceField,
adding processTV=`1` and useTV=`1` field=`your_tvfieldname`

processedTV is obtained from the value in the TV variable.
So instead of the value directly "test", you have to put in your binding syntax as value.
Example: "@select listlabel from modx_listvalues where listkey='postcategory' and listvalue='test';

If you dont like the way of putting syntax into the value box, you may try to use snippet to pass in the value to get the value to display. I think this is the better way.

No comments: