Taffrail Var
HTML Advice content includes Web Components.
When requesting HTML Advice content, the API will return HTML strings containing Web Components (custom HTML elements) named taffrail-var which reference individual Variables. These elements have several attributes useful for developing interactive user interfaces.
Requesting HTMLTo request formatted HTML, use the
+htmlmodifier on the Accept header as follows.Accept: application/vnd.taffrail.json+html
Inspecting an ADVICE item in the advice[] list, the following properties would be present. In the headline_html field, look for the <taffrail-var> HTML element.
{
"headline": "Because your income is above $198,000, you are not eligible for a Roth IRA and should consider a Traditional IRA instead."
"headline_html": "Because <a href=\"#Roth_Eligibility\" data-variable-id=\"EbAx0DxX9Bm490AALrEPV\" class=\"taffrail-var\"><taffrail-var data-variable-type=\"Freetext\" data-variable-name=\"Roth_Eligibility\" data-variable-id=\"EbAx0DxX9Bm490AALrEPV\" data-variable-raw-value=\"Income too high for a Roth\">your income is above <taffrail-var data-variable-type=\"Number\" data-variable-format=\"$0,0\" data-variable-name=\"IRS_Limit_Roth_MFJ_Income_Low\" data-variable-id=\"Bj09EXCZkhOiKxdsa4UaL\" data-variable-raw-value=\"198000\">$198,000<\/taffrail-var><\/taffrail-var><\/a>, you are not eligible for a Roth IRA and should consider a Traditional IRA instead.\n"
}
DemoTry this on the Advice Content Types page.
In HTML mode, every Variable is wrapped with a <taffrail-var> element. The following data- attributes can be found on each element.
These properties correspond to the Variable meta.
data-variable-typeThe data type of that Variable (see also: Form Templates)data-variable-nameThe canonical name of the Variabledata-variable-idThe unique Variable ID, useful to lookup in the API'svariablespropertydata-variable-raw-valueThe raw, unformatted value of the Variabledata-variable-formatThe formatting string for the Variable, see Variables: Format for more.data-variable-is-undefinedThis exists only if an Unknown Variable Reference error occurs (e.g.,#VARIABLE_NAME!)data-variable-systemThis exists only iftrueand indicates a "system" Variabledata-variable-constantThis exists only iftrueand indicates a "constant" Variable, one that should not changedata-variable-is-toggleableThis exists only iftrueand indicates a Variable is toggleable.data-backlink-nameThe canonical name of the Backlinkdata-backlink-requiredA boolean to indicate a Backlink chip should be rendered in the user interface.
Updated about 1 month ago
