View parameters are parameters defined by the graphic charter and assigned to the back office of your application. They influence the rendering of your pages, content and services.
There are 5 types of view settings:
Template parameters
Zone parameters
Zone item parameters
Service parameters
Content parameters
Law
To access the buttons for configuring view parameters, the user must have the View parameters right in the Page rights section.
Authorized types
Here are the different parameter types supported:
String
Oops!
Copy to clipboard failed. Open the code and copy it manually.
It's important to add the widget parameter allowSources = resource for the declaration of a file type parameter, as currently only explorer resources are supported.
Template parameters
Definition
Les paramètres de gabarit doivent être définis dans le fichier templates/[NOM_GABARIT]/template.xml du gabarit défini dans votre charte graphique. Les paramètres sont définis sous une balise <parameters> comme dans l'exemple ci-dessous:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
or from the Page with template > Template settings Page tab
or from the View settings active when selecting a zone or zone element (content or service)
This button is selection-dependent, so it can provide additional view parameters related to zone, zone-item, service and content.
A dialog box displays the parameters available according to the selection, grouped by type:
Click "Ok" to save your settings.
Heritage
Template view parameters are inherited. By default, they are not inherited, so that if the parameter is not filled in, it remains empty, regardless of the value filled in on the parent page. It is therefore possible to integrate a notion of inheritance that allows, when a view parameter is not filled in, to retrieve its value from its parent.
To do this, use the inherit attribute on the parameter tag. Its value can be :
inherit attribute value
Meaning
*
It inherits the view parameter with the same name from the parent page.
* -> [parameter name]
It inherits the view parameter with name [parameter name] from the parent page, whatever its template.
[template name] -> [parameter name].
It inherits the view parameter with name [parameter name] from the parent page if its template is [template name].
[template name] -> empty
This view parameter is not inherited if the parent page's template is [template name].
Case 1 - No inheritance
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<parameter name="param1"/>
<parameter name="param1"/>
<parameter name="param1"/>
The inherit attribute does not exist, there is no inheritance.
Case 2 - Simple inheritance
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<parameter name="param1" inherit="*"/>
<parameter name="param1" inherit="*"/>
<parameter name="param1" inherit="*"/>
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<parameter name="param1" inherit="*->param1"/>
<parameter name="param1" inherit="*->param1"/>
<parameter name="param1" inherit="*->param1"/>
Parameter param1 inherits parameter param1 from the parent page (provided it is properly defined in the parent page template).
Case 3 - Inheritance from another parameter
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<parameter name="param1" inherit="*->param2"/>
<parameter name="param1" inherit="*->param2"/>
<parameter name="param1" inherit="*->param2"/>
Parameter param1 inherits parameter param2 from the parent page (if param2 is defined on the parent page template).
Case 4 - Inheritance by template
Oops!
Copy to clipboard failed. Open the code and copy it manually.
parameter param2 if the parent page uses template t2,
nothing if the parent page uses the t3 template,
parameter param1 in all other cases.
The order in which inheritances are defined is therefore important. If *->param1 were defined first, the rest would be irrelevant.
Use in the graphic charter
In our example, this template parameter is used to change the default banner illustration. Using the XSLT AmetysXSLTHelper helper, you can display the header image on the skin side.(See helper documentation)
For example:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Zone parameter settings can be accessed via the Set view button, which is active when a zone or zone element (content or service) is selected.
This button is selection-dependent, so it can provide additional view parameters related to template, zone element, service and content.
A dialog box displays the parameters available according to the selection, grouped by type:
Click "Ok" to save your settings.
Heritage
Zone view parameters are inherited. By default, they are not inherited, so that if the parameter is not filled in, it remains empty, regardless of the value filled in on the parent page. It is therefore possible to integrate a notion of inheritance that allows, when a view parameter is not filled in, to retrieve its value from its parent.
To do this, use the inherit attribute on the parameter tag. Its value can be :
inherit attribute value
Meaning
*
It inherits the view parameter with the same name from the zone with the same name on the parent page.
* -> [zone name] -> [parameter name].
It inherits the view parameter with name [parameter name] from zone [zone name] on the parent page, whatever its template.
The param1 parameter of the default zone inherits the param1 parameter of the default zone of the parent page (if set to the default zone of the parent page).
Case 3 - Inheritance from another parameter
Oops!
Copy to clipboard failed. Open the code and copy it manually.
The param1 parameter of the default zone inherits the param2 parameter of the z1 zone of the parent page (if param2 is set to the z1 zone of the parent page).
Case 4 - Inheritance by template
Oops!
Copy to clipboard failed. Open the code and copy it manually.
The param1 parameter of the default zone inherits :
parameter param2 in zone z2 if the master page uses template t2,
nothing if the parent page uses the t3 template,
parameter param1 of zone z1 in all other cases.
The order in which inheritances are defined is therefore important. If *->z1->param1 were defined first, the rest would be irrelevant.
Use in the graphic charter
In our example, this view parameter is used to change the zone's background color. Using the XSLT ViewParametersXSLTHelper helper, you can change the zone's color.(See helper documentation)
For example:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
As with template and zone parameters, zone element parameters must be defined in the file templates/[TEMPLATE_NAME]/template.xml of the template defined in your graphic charter.
Les paramètres d'élément de zone sont définis sous une balise <zone-items> de la zone concernée, comme dans l'exemple ci-dessous:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Zone parameter settings can be accessed via the Set view button, which is active when a zone or zone element (content or service) is selected.
This button is selection-dependent, so it can provide additional view parameters related to template, zone, service and content.
A dialog box displays the parameters available according to the selection, grouped by type:
Click "Ok" to save your settings.
Use in the graphic charter
In our example, this view parameter lets you change the background color of the zone item and add an icon. Using the XSLT ViewParametersXSLTHelper helper, you can change the color of the zone item and display the icon(see helper documentation).
For example:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Service view parameters must be defined in the services/[PLUGIN_NAME]/pages/services/[SERVICE_NAME]/[VIEW_NAME] view description file .xml in your graphic charter.
For example, to define parameters for the service gallery view displaying the contents of a resource explorer directory, the file modified is services/web/pages/services/explorer-folder/galery_3.3.xml.
Les paramètres sont définis sous une balise <parameters> comme dans l'exemple ci-dessous:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
To define content view parameters, create a XML file associated with the content view in the graphic charter.
For example, to define parameters for the "main" view of an article content type, create a folder with the content type identifier org.ametys.web.default.Content.article as its name, and add a xml file with the same name to this folder, associating a suffix for the content view: org.ametys.web.default.Content.article-main.xml.
The path to XML is: skins/[NOM_SKIN]/stylesheets/content/org.ametys.web.default.Content.article/org.ametys.web.default.Content.article-main.xml.
In this file, content view parameters are defined as in the example below:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<content>
<parameters>
<parameter name="hideTitle" type="boolean">
<label i18n="false">Cacher le titre</label>
<description i18n="false">Cacher le titre</description>
</parameter>
</parameters>
</content>
<content>
<parameters>
<parameter name="hideTitle" type="boolean">
<label i18n="false">Cacher le titre</label>
<description i18n="false">Cacher le titre</description>
</parameter>
</parameters>
</content>
<content>
<parameters>
<parameter name="hideTitle" type="boolean">
<label i18n="false">Cacher le titre</label>
<description i18n="false">Cacher le titre</description>
</parameter>
</parameters>
</content>
Setting
You can set the view parameters for a content item:
or from the View settings active when selecting content:
or from the Content view > View settings
A dialog box displays the parameters available according to the selection, grouped by type. Also included are any template, zone and zone element parameters.
The content view can be modified from this dialog box.
Click "Ok" to save your settings.
This dialog box also allows you to select the content view
Use in the graphic charter
You can retrieve view parameters in content rendering using the XSLT ViewParametersXSLTHelper helper(see helper documentation).
In our example here, the view parameter is used to hide the main content title:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
All these parameters will be added to the view parameters defined individually for each template, zone, item zone, content or service. Managing these parameters is the same as explained above.
Please note that parameter names must be unique by type. For example, if a global template parameter is named "image", it will not be possible to name another "local" template parameter with the same name.