getTvDisplayName

Creator: Nick Crossland (ncrossland)

Need help installing this extra?

About getTvDisplayName

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 

Information

Released
April 15, 2011

Supported Database
MySQL, SQL Server

License
GPLv2

Supported Versions
2.0 - Current

Downloads
2,751

Instructions

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.

New in 1.1.0-pl

1.1-pl

  • Support TVs which use delimiters to display more than one value

1.0-pl

  • Initial public release

Current releases

1.1.0-pl
View | Download
April 15, 2011
2.0 - Current