Tag: Difference between revisions
mNo edit summary |
|||
(12 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Text in | Text in [[Panel]]s can contain special tags that are replaced by the {{software}} based on the Project's data, the [[Session]]'s data, and the context of the [[Panel]], such as the [[Stakeholder|owner]] or related [[Item]]s of the [[Panel]]. A tag can be placed anywhere in the text of a [[Panel]], and when the content of that [[Panel]] is rendered for display to the user, the tag is replaced by the appropriate data. In other words, the tag specifies a specific kind of data, and that data is inserted into the [[Panel]]'s text in the location of the tag. | ||
===General tags=== | ===General tags=== | ||
{|class=wikitable | |||
! Tag | |||
! Effect | |||
|- | |||
| $PROJECT_NAME | |||
| Inserts the name of the [[Project]]. | |||
|- | |||
| $TOKEN | |||
| Inserts the [[Web Token]] of the [[Project]]'s [[Session]]. | |||
|- | |||
| $SESSION | |||
| Inserts the url web endpoint of the [[Project]]'s [[Session]]. | |||
|} | |||
===Web tags=== | ===Web tags=== | ||
{|class=wikitable | |||
! Tag | |||
! Effect | |||
|- | |||
| $LIB_CUSTOM | |||
| Inserts the name of the [[custom javascript library]], part of the [[web interface]] configuration. | |||
|} | |||
===Contextual tags=== | ===Contextual tags=== | ||
{|class=wikitable | |||
! Tag | |||
! Effect | |||
|- | |||
| $NAME | |||
| Inserts the name of the [[Item]] the [[Panel]] is related to.<br> | |||
If not used with a [[Template Panel]], an empty string is inserted. | |||
|- | |||
| $ID | |||
| Inserts the [[ID]] of the [[Panel]].<br> | |||
If not used with a [[Template Panel]], "-1" is inserted. | |||
|- | |||
| $STAKEHOLDER_ID | |||
| Inserts the [[ID]] of the user's [[Stakeholder]]. | |||
|- | |||
| $STAKEHOLDER | |||
| Inserts the name of the user's [[Stakeholder]]. | |||
|} | |||
===Attributes tags=== | ===Attributes tags=== | ||
{|class=wikitable | |||
! Tag | |||
! Effect | |||
|- | |||
| $ATTRIBUTE_ATTRIBUTENAME, where ATTRIBUTENAME is the [[TQL name|name]] of the [[Attribute]]. | |||
| Inserts the value of the indicated [[Attribute]] of the [[Item]] the [[Panel]] is related to.<br> | |||
If the [[Attribute]] does not exist for the [[Item]], an empty array is inserted, i.e. "[]". | |||
If not used with a [[Template Panel]], the tag is not replaced. | |||
|- | |||
| $GLOBAL_GLOBALNAME, where GLOBALNAME is the [[TQL name|name]] of the [[Global]]. | |||
| Inserts the value of the indicated [[Global]]s. If the [[Global]] does not exist, it is considered "0". | |||
|} | |||
{{article end | |||
| notes= | |||
* Tags can also be used in the output of [[Panel]]s based on an [[Excel]], and in [[Indicator]]s. | |||
* Text in the output which starts with a dollar-sign (like a tag) but is not explicitly a tag to the {{software}}, is not replaced or overwritten. | |||
* [[Attribute]] and [[Global]] values are inserted with at least one decimal. I.e. "2" and "2.203" are displayed as "2.0" and "2.203" respectively. | |||
* If an [[Attribute]] is inserted which does not have exactly one value (i.e. does not exist, or is an [[Attribute array]] with multiple values), an array of values is inserted compatible with a [[javascript]] array definition. | |||
| seealso= | |||
* [[Panel]] | |||
* [[Template Panel]] | |||
* [[Global]] | |||
* [[Attribute]] | |||
}} |
Latest revision as of 10:35, 27 October 2020
Text in Panels can contain special tags that are replaced by the Tygron Platform based on the Project's data, the Session's data, and the context of the Panel, such as the owner or related Items of the Panel. A tag can be placed anywhere in the text of a Panel, and when the content of that Panel is rendered for display to the user, the tag is replaced by the appropriate data. In other words, the tag specifies a specific kind of data, and that data is inserted into the Panel's text in the location of the tag.
General tags
Tag | Effect |
---|---|
$PROJECT_NAME | Inserts the name of the Project. |
$TOKEN | Inserts the Web Token of the Project's Session. |
$SESSION | Inserts the url web endpoint of the Project's Session. |
Web tags
Tag | Effect |
---|---|
$LIB_CUSTOM | Inserts the name of the custom javascript library, part of the web interface configuration. |
Contextual tags
Tag | Effect |
---|---|
$NAME | Inserts the name of the Item the Panel is related to. If not used with a Template Panel, an empty string is inserted. |
$ID | Inserts the ID of the Panel. If not used with a Template Panel, "-1" is inserted. |
$STAKEHOLDER_ID | Inserts the ID of the user's Stakeholder. |
$STAKEHOLDER | Inserts the name of the user's Stakeholder. |
Attributes tags
Tag | Effect |
---|---|
$ATTRIBUTE_ATTRIBUTENAME, where ATTRIBUTENAME is the name of the Attribute. | Inserts the value of the indicated Attribute of the Item the Panel is related to. If the Attribute does not exist for the Item, an empty array is inserted, i.e. "[]". If not used with a Template Panel, the tag is not replaced. |
$GLOBAL_GLOBALNAME, where GLOBALNAME is the name of the Global. | Inserts the value of the indicated Globals. If the Global does not exist, it is considered "0". |
Notes
- Tags can also be used in the output of Panels based on an Excel, and in Indicators.
- Text in the output which starts with a dollar-sign (like a tag) but is not explicitly a tag to the Tygron Platform, is not replaced or overwritten.
- Attribute and Global values are inserted with at least one decimal. I.e. "2" and "2.203" are displayed as "2.0" and "2.203" respectively.
- If an Attribute is inserted which does not have exactly one value (i.e. does not exist, or is an Attribute array with multiple values), an array of values is inserted compatible with a javascript array definition.