...
The templates parameters are the parameters that will be required of from the user of the template and will have to fill be filled in when they are going to use using it.
When filling in the form, the parameter will be replaced by the value selected for it.
To use them we will , drag them to the text editor TEMPLATE CODE HTML&CSS text editor (DROP ZONE). Since From version 2.1.3-gradiusversion also in Javascript section, this will also work in the JavaScript section.
Text Label Parameter:
This parameter will be replaced by the string that is written in the form when we you use the template in the dashboard.
All of these comments contain a name parameter to differentiate them from each other. We Besides, you can also use the same comment in several places of the code sites if we you want to specify the same string in different parts of the code, thus not having to fill in several fields of the form that appears after when selecting the template for its use.
Number Label Parameter:
This parameter will ask prompt for a number in on the form after selecting the template for its to use.
Label with Datasource data from a Data Source:
This parameter is replaced by the value of the datasource that we you select in the form.
Label with Data Source parameter name of Datasource:
This is replaced by the name of the field of the data source field that we you select in the form.
This is useful if in our html code we you want to write the name of the data source parameter to use it in your html code.
For example, if we created you create a template where displaying a graph was shown, you can put this in the values of of the axes we could put this so that, in the previous form, we would you can choose which fields would show will be shown in each axis.
Label to that will be loaded with the value chosen value from a list:
In this Here, we will save some options that the user of the template user can then later select, and the selected option comment will be replaced by the commentselected option.
In the options field we will , you must put the different options separated by commas.
We You can test the template by accessing show gadget template where we Show Gadget Template, where you can change the parameters by to values , and select a datasource to check if the template meets the expected requirements that are expected of it.
We will create Create an example template with parameters to see how to use them
For the example we , you will create a simple value gadget:
First step we , go to the screen to create the template gadget.
We give Give it an identifier and a description.
We insert Insert the code, which has a text type parameter and another type Label type , with a Datasource Data Source parameter name.
Code Block | ||
---|---|---|
| ||
<style> .card-count{ color: #2e43ab; font-weight: bold; font-size: -webkit-xxx-large; padding-left: 20px; } .card-title{ color: #000000; font-weight: bold; font-size: x-large; } .card-green{ color:green; } .my-card{ padding: 15px; } .card-icon{ padding-top: 0px; padding-left: 0px; padding-bottom: 25px; padding-right: 25px; } </style> <div class="my-card"> <md-icon class="card-icon" style="font-size:35px">assessment</md-icon> <label class="card-title"><!--label-osp name="title" type="text"--></label><br> <label class="card-count">{{ds[0].<!--label-osp name="ontology field" type="ds_parameter"-->}}</label> </div> |
Save and go our to your dashboard.
We will drag Drag the icon where we you want our your template gadget to appear.
We select Select the template and we find a form to fill out will appear.
After entering the datasource and the title text, and selecting the value to display, we you will see the gadget in our your dashboard with this appearance:
...