Static texts

From GruppoZenit
Jump to: navigation, search

In Z-CMS a static text is a text that can be used several times inside a site or webpages.

The static text section provides option to create, store and manage reusable or sharable text in a particular language along with its translations in other languages. This approach enables possibility to include static texts in websites having multi-language behaviour, that are expected to display text in accordance with the language opted by the website visitor.

Static text can be created at a Global level or at Site level. The process of creation and editing of static text at the different levels is the same. The only difference is that in one case the creation is done while being inside the Global part and in the other case while being inside the Sites part. For the second one a detailed description is presented below.

A site specific static text can be created in the following way:

  • From the Site’s dashboard page select Static texts 1.png --> Themes 3.png and a new page opens with the fields reported inside the table below:
Field ( * denotes mandatory field) Description
Name* A name to identify the static text
Type* A text to identify the category the particular static text belongs to
[Default language]* Text in the default language
[Other defined languages] Translated text in other defined languages
Note: the combination of Name and Type must be unique.
  • Save by clicking the button Sites part 5.png.

To edit a static text do the following:

  • Go to the static text list from the Site dashboard page by selecting label Static texts 1.png.
  • Go to the static text detail by clicking on the static text row in the list.
  • Make necessary editing and save.

Editing of a particular static text also enables option to create a new static text having the same name but a different type or category. Static texts are presented in the list grouped by their names. So static text types can be effectively used to organize static texts in Z-CMS.

Example: Creation of a static text inside a site

Consider the text “Click here for details” which is often required to be displayed in a link label in a website with multi-language behaviour.

The steps to create a “Details” static text are the following:

  • Click Static texts 1.png from Site dashboard page menu and select Themes 3.png
  • Input text in the default language and in other defined languages appropriately as shown in the figure:

Static texts 2.png

Remember that text in the default language is mandatory.
  • Click save.

Now the static text can be presented in a webpage or can be included in a Widget using Z-CMS zcms:content-static tag as follows:

<zcms:content-static name="Details_Label" />

Text will be displayed automatically in accordance with the language opted by the website visitor as shown, as an example, in the table below.

[Object] Name Type Text in English Text in Italian
[Static Text 1] company name Gruppo Zenit Gruppo Zenit
[Static Text 2] company copyright All rights reserved Tutti i diritti riservati

See also

Personal tools