Using the parameters mechanism in our include component, you can write snippets that can be reused by multiple components that could not be used before.
It allows you to customize various values per include, such as a fieldLabel, fieldDescription, whether to show or hide a field or not, to give it default values etc.
Syntax
The way it works is that in a property value (not a property key!) in the dialog XML you put the following expression:
So at minimum you will need:
When you want to typecast that value to a Boolean:
And if you also would live to give it a default value of true:
The example
Enough talk, now for the actual example.
We will define 1 dialog snippet. The snippet will have a simple title and description.
But some stuff will be customize-able on a include basis.
The snippet will be created under: /apps/path/to/block.xml
Then we will define the actual dialog that will include the main snippet:
The result is the following dialog:
First tab (block1)
As you can see, the titles / descriptions adjust according to the parameters.
Second tab (block2)
As you can see the extra field is hidden here.
If you save the dialog this is the result in CRX:
Possible Typecasts
Currently the possible typecasts are : Boolean, Long, Double, String.