Texttemplates

Skip to end of metadata
Go to start of metadata

Texttemplates

Texttemplates help to ensure consistently formulated product texts and simplify modification of formulations of text parts. They are created once in a central store and can be used in numerous objects on different positions. Since they are stored in a central store, they can be edited in one place later on and all objects using the template will be updated automatically.

Configuration and Translations

Once the plugin is installed, you can edit the default language in the plugin configurations. This is important, since Texttemplates support multi language input. The translatable languages can be configured with the pimcore system setting ‘valid languanges in frontend’ – same like localized fields.

Create and Manage Texttemplates

In the Texttemplates grid, existing Texttemplates can be filtered, edited or deleted and with ‘Add new Texttemplate’ new ones can be created.
By Adding a new Texttemplate a name has to be specified. With this name, Texttemplates can be included into objects later on.

Edit Texttemplates

The text of a Texttemplate is specified with a default WYSIWYG editor. All options of the editor can be used. For each activated language there is a editor in which the corresponding text can be inserted.

Variables

Texttemplates can include variables. The values of these variables can be defined when including the Texttemplate into an object.
Variables are added with

#{VARIABLENAME}#

If no value is specified, pimcore tries to get a value from the current object. So Texttemplates can have content dependent on the object, they are added to. E.g. if a Texttemplate has the variable ‘name‘ and no value is specified, pimcore tries to call ‘getName()’ on the current object and uses the returned value.
With ~ in the variable name subsequent getters can be called. This is useful to get values from object bricks. So bricks~general~weight results in the call of

$object->getBricks()->getGeneral()->getWeight();

Use Texttemplates

Create Fields

To insert Texttemplates into an object, a field of the type ‘WYSIWIG with Texttemplates’ has to be added. Basically this is a default WYSIWYG field. Additionally Texttemplates can be inserted and a preview of the compiled text can be shown.

Insert Texttemplates

To insert a Texttemplate, switch to the edit mode, open the Texttemplate search dialog, select the Texttemplate to insert, optionally define values for the variables and insert the template.

The inserted text will look somehow like

@{lingdesc_intro nicename="24/7-plus"}@

This stands for

@{TEXTTEMPLATE_NAME VARIABLENAME=”VALUE”}@

If you know the name of your Texttemplate, you simply can insert the text described above without using the Texttemplate search dialog.
To see a preview of the text with the compiled Texttemplates switch back to preview mode.

Language of Texttemplates

If no language is defined, the specified default language of the Texttemplate is used. To override the default language, use following syntax:

@{langdemo language="de"}@

Texttemplates in Texttemplates

Texttemplates can include other Texttemplates. They will be compiled recursively.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.