by Variantic Team| 24.11.2022| Variantic 2.7.1

Parameters in the Documentation

Type: Text and Bool

Intro

The most common parameter types used in the documentation are Bool, Text and Projection. Two of these require special  construction rules. Below you will find the instruction how to build an if statement and how to create a reference to different parameters. 

Parameter type: Bool

Boolean parameter is a data type with two possible values: true or false. It is used to show or hide element e.g. images, projections or pages.

Find the field "Visible" and select form the list "Depends on Parameter". The second list gives you the ability to select a parameter that will determine the visibility of the element. Rules must be specified in the Publication tab (Documentation sub-tab). 

rule example
expected value 0 or 1 1
reference to a general parameter #parameter_name #b
reference to a custom parameter parameter_name r_custom
If statement - logical expression based on a general parameter
if(#parameter_name ==1,1,0)
if(#b==1,1,0)
If statement - logical expression based on a custom parameter
if(parameter_name ==1,1,0)
if(r_custom==1,1,0)

Parameter type: Text

Text parameter is used to to create text block dependent on the given condition of a parameter.

Text parameter must be specified not only in Publication tab but also on the documentation page. Add a text field and enter the name of the parameter in double braces. Then position it on the page. Text must be entered in the Publication tab (Documentation sub-tab). All acceptable construction rules are shown below. 

rule example
expected value string or value
string expected_string
Hello World!
reference to a general parameter {{#parameter_name}}
{{#b}}
reference to a custom parameter {{parameter_name}}
{{r_custom}} note - if the custom parameter has a string as a resulting value, the documentation will return 0
translations
translation_key
KEY001_yes
If statement - logical expression based on a general parameter (string as a resulting value)
{{if(#parameter_name==1, ”string_if_true”,”string_if_false”)}}
{{if(#b==2, "monday","friday")}}
If statement - logical expression based on a custom parameter
{{if((#parameter_name==1, ”translation_key”,”string_if_false”)}}
{{if(#b==2, "KEY001_yes","friday")}}
If statement - logical expression based on a custom parameter (string as a resulting value)
{{if(parameter_name==1, ”string_if_true”,”string_if_false”)}}
{{if(r_custom==2, "monday","friday")}}
If statement - logical expression based on a custom parameter (translation key as a resulting value)
{{if(parameter_name==1, ”translation_key”,”string_if_false”)}}
{{if(r_custom==2, "KEY001_yes","friday")}}