{field2html:field_id}

Description

Renders one field of the current item as HTML. For a plain-text field, the value is HTML-escaped, bare URLs are turned into clickable links, and newlines become line breaks. A field already flagged as HTML is returned unchanged. An empty field, an unknown field name, or no current item all yield an empty string. The single parameter field_id is the field id (for example abstract........ or full_text.......), not a field alias. Because the field id is read against whichever item is current when the command runs, inside an item or view loop you must wrap the call in deferred-eval parentheses so it binds to the looped item rather than the surrounding template item.

Parameters

field_id required default (none)

The field id to render, for example abstract........ or full_text....... (use the field id, not a field alias). The field is read from the current item; if the item has no such field, or the field is empty, the result is an empty string.

Examples

test{item:5726c2c6b035d7aab450d1794e9e90d7:{({field2html:full_text.......})}}
ExpectedGamma contains color data: red green blue. Used for string tests.
ActualGamma contains color data: red green blue. Used for string tests.
For a longer plain-text field the value is HTML-escaped, bare URLs become links, and newlines become line breaks. This sample has none of those, so it renders verbatim; the colon inside the text is preserved.
test[{item:5726c2c6b035d7aab450d1794e9e90d7:{({field2html:abstract........})}}]
Expected[red]
Actual[red]
Reads the abstract........ field of a fixed item and renders it as HTML. The value is plain text with no special characters, so it passes through unchanged. The deferred-eval parentheses ( ) are required inside item so the field is read from the looped item, not the surrounding template item.
test[{item:5726c2c6b035d7aab450d1794e9e90d7:{({field2html:headline........})}}]
Expected[Gamma]
Actual[Gamma]
The same field id mechanism works for any field id. Here it renders the headline........ field of the bound item.
virtual[{item:5726c2c6b035d7aab450d1794e9e90d7:{field2html:headline........}}]
Expected(reads the surrounding item, not Gamma - use deferred-eval)
Actual[Trap: without deferred-eval the field reads the wrong item]
Without the deferred-eval parentheses the inner field2html is expanded before item binds the looped item, so it reads the surrounding template item instead of the fixture. Here it returns the headline of whatever item is rendering this page, not Gamma. Always wrap field2html in ( ) inside item or view. The correct, deterministic form is the first example.
test[{item:5726c2c6b035d7aab450d1794e9e90d7:{({field2html:nosuchfield.....})}}]
Expected[]
Actual[]
If the current item has no field with that id, the result is an empty string - shown here by the empty brackets. An empty field value behaves the same way.