getTvDisplayName
gettvdisplayname
About
An output filter to retrieve the display value of a TV, given the stored value. For example, if you have a TV which is a checkbox or listbox, you may have specified separate labels and values such as:
For the money==1||For the show==2||To get ready==3||Go cat go==4
If you then output the value of the TV in a template using
[[*elvis]]
it will output something like:
3
If you use this snippet as an output filter, it will instead retrieve the labels associated with the values that you have specified in your TV setup. So put in your template
[[*elvis:getTvDisplayName]]
it will output
To get ready
Installation & usage
Download via package management.
if you have a TV which is a checkbox or listbox, you may have specified separate labels and values such as:
For the money==1||For the show==2||To get ready==3||Go cat go==4
If you then output the value of the TV in a template using
[[*elvis]]
it will output something like:
3
If you use this snippet as an output filter, it will instead retrieve the labels associated with the values that you have specified in your TV setup. So put in your template
[[*elvis:getTvDisplayName]]
it will output
To get ready
Sometimes the filter will have trouble because the TV name isn't put in the code exactly as it is setup in the manager - for example in a getResources template chunk, by default TV names are prefixed with
tv.
To work round this, you can supply the prefix to ignore as the parameter, e.g.
[[+elvis:getTvDisplayName=`tv.`]]
If a TV type allows more than one value to be selected (e.g. checkboxes, list (multi)) you should set an output option for the TV of "delimiter" which will separate the values with a delimiter of your choice, for example a comma.
This snippet will replace every value, based on the delimiter. You should ensure your delimiter isn't going to occur in your TV display options - e.g. if your TV display options contain commas, don't choose comma as your delimiter. You might want to choose an unusual character such as §.
You may want to further format the display of your TV values using other output filters such as :replace, e.g.
[[+elvis:getTvDisplayName=`tv.`:replace=`,==<br/>`]]
to display each item on a new line.
At a glance
MODX 3 compatibility unknown. Based on our testing and community reports where available.
- Developer ncrossland
- Latest release April 15, 2011 (15 years ago)
- First seen in SiteDash April 15, 2011 (15 years ago)
- License GPLv2
- MODX support 2.0 – 100.0
| Changelog | |||
|---|---|---|---|
| MODX.com |
1.1-pl |
April 15, 2011
15 years ago |
|
|
<p><b>1.1-pl</b></p><ul><li>Support TVs which use delimiters to display more than one value</li></ul><p><b>1.0-pl</b></p><ul><li>Initial public release</li></ul>
|
|||
|
No matching releases. |
|||