|EVALTAG(TAG)|
|EVALCONST(CONSTANT)|
Sometimes a conditional tag or filter requires evaluating another sub-tag or constant. The EVALTAG and EVALCONST commands allow you to evaluate a tag or constant from within the context of another tag.
#Display a '-' if a score is NULL, otherwise display the score{DATAPOINTS.SCORE=|EVALCONST(NULL)|?-:|EVALTAG(DATAPOINTS.SCORE)|}
#Display datapoints in the current month
{|RESULT|FILTER=MONTH_YEAR_ID|eq||EVALTAG(THIS_MONTH_YEAR_ID)|}
{|LOOP|RESULT.DATAPOINTS}
...
{/|LOOP|}
{/|RESULT|}
#Display datapoints for the past week
{|RESULT|FILTER=TRENDING_TIMESTAMP|gte||EVALTAG(LAST_7_DAYS)|}
{|LOOP|RESULT.DATAPOINTS}
...
{/|LOOP|}
{/|RESULT|}
#Hide certain content if we're not in 'standard' display mode
{|SHOWIF|OUTPUT_MODE=|EVALCONST(KNICKERS_OUTPUT_STANDARD)|}
...
{/|SHOWIF|}
Tags available for use with EVALTAG include:
- THIS_MONTH_YEAR_ID - The MONTH_YEAR_ID of the current month
- LAST_MONTH_YEAR_ID -The MONTH_YEAR_ID of the previous month
- THIS_YEAR_ID - The YEAR_ID of the current year
- LAST_YEAR_ID - The YEAR_ID of the previous year
- LAST_7_DAYS - The date 7 days ago
- LAST_30_DAYS - The date 30 days ago
- TODAY - Today’s date in Y-m-d format
Constants available for use with EVALCONST include:
- NULL
- KNICKERS_OUTPUT_STANDARD* - In standard output mode
- KNICKERS_OUTPUT_PRINT - In print output mode
- KNICKERS_OUTPUT_SPREADSHEET - In spreadsheet output mode
- KNICKERS_OUTPUT_PDF - In PDF output mode
* The framework on which ToolZ is written is called Knickers