List of Text Panel tags

From Tygron Support wiki
(Redirected from List of Text Panel tokens)
Jump to navigation Jump to search

When requesting the text content of a panel through any of the web endpoints, the content returned is formatted and tags are replaced. These tags can be general tags, values of attributes and globals, as well as TQL Select statements.

Tags should always be preceded by a dollar sign ($), for example: $SELECT_GLOBAL_WHERE_NAME_IS_FOO

$TQL Tags

Select queries can also be added to a text panel to obtain Project Session data. These select queries should always be preceded by a dollar sign ($) and need a Calculation to be updated. For example:

To get an attribute named FOO of the item linked to this panel (note: available in version 2026.1.1+):

$SELECT_ATTRIBUTE_WHERE_PANEL_IS_ID_AND_RELATION_IS_CONTENT_AND_NAME_IS_FOO.

To get the name of the item linked to this panel (note: available in version 2026.1.1+):

$SELECT_NAME_WHERE_PANEL_IS_ID_AND_RELATION_IS_CONTENT.

To get the contents of a global named FOO:

$SELECT_GLOBAL_WHERE_NAME_IS_FOO.

To get all the neighborhood names in the Project. Note X is a wildcard here:

$SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X.

Only select queries can be used and require a recalculation when added or adjusted.

HTML, CSS and Javascript

Text content of a text panel is always presented as HTML. In case the text content is not presented as HTML, the <html> and <body> tags are added around the text content.

General Tags

Name Description
$PROJECT_NAME Formatted project name
$PLATFORM_DESCRIPTION Client description of the Tygron Platform
$LIB_CUSTOM Lower-case underscored project name
$TITLE Title of the panel
$CSS Replaced with relative stylesheet link: <link rel=\"stylesheet\" type=\"text/css\" href=\"tygron.css?token=$TOKEN\">
$LIB_PLOTLY Replaced with header script entry for Plotly; <script src=\"plotly.js?token=$TOKEN\" type=\"text/javascript\"></script>
$TOKEN Web token or Api token, depending on the context.
$STAKEHOLDER_ID id of the stakeholder; Stakeholder is obtained from the accessing web stakeholder or from a specified stakeholder id in the end point.
$STAKEHOLDER_SHORT short name of the stakeholder; Stakeholder is obtained from the accessing web stakeholder or from a specified stakeholder id in the end point.
$STAKEHOLDER name of the stakeholder; Stakeholder is obtained from the accessing web stakeholder or from a specified stakeholder id in the end point.

Legacy Tags

The following tags are deprecated and not to be used anymore, but kept for backwards compatibility.

Name Description
$SESSION Replaced with empty string
$SLOT Replaced with empty string
$ID Replaced with the id of the linked item.
$NAME Replaced with the name of the linked item.
$ATTRIBUTE_ Replaced with the value for the attribute specified after $ATTRIBUTE_, obtained from the linked item.
$GLOBAL_ Obtains the value of the Global specified after $GLOBAL_ from the linked item.

Limitations

Tags, as well as Globals, attributes and TQL Select statements are only replaced in the text content; They cannot be stated dynamically with javascript. I.e. Generally only capital letters, numbers, underscores are supported for tags. Characters such as , ( ) [ ] { } < and &gt cannot be used.

In the following example, the Select statements are not properly replaced and will therefore not work.

const tableData = [];
for (const nh of neighborhoods) {
  const nameQuery = `$SELECT_NAME_WHERE_NEIGHBORHOOD_IS_${nh.id}`;
  const valueQuery = `$SELECT_ATTRIBUTE_WHERE_NEIGHBORHOOD_IS_${nh.id}_AND_NAME_IS_INHABITANTS`;
  tableData.push({
    name: nh.name,
    inhabitants: valueResult[0] // TQL returns an array of results
  });
}

Instead, the select statement should written as followed:

const neighborhoodNames = [ $SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X ];
const neigbhorhoodInhabitants = [ $SELECT_ATTRIBUTE_WHERE_NEIGHBORHOOD_IS_X_AND_NAME_IS_INHABITANTS ];

const tableData = [];
for(let n = 0; n < neighbhorhoodNames.length && n < neighborhoodInhabitants.length; n++){
  tableData.push({
    name: neighborhoodNames[n];
    inhabitants: neighborhoodInhabitants[n];
  });
}

For further specification details, see Global, Attribute and Select (TQL) respectively.