Snippets
4.2.1 What is the Snippets?
A Snippet is a small template that represents a value from the context of the current process. The purpose of using a Snippet is to tightly integrate process properties with content data. This helps users build advanced features; and better manage pre and post processing.
4.2.2 How it Works?
Using a iLangl Snippet is very simple. Users need to specify Snippets in the text. During text pre-processing it will be replaced to the related value. For example:
<{encodedcontentype}_{encodedsectionname}>
For Sitecore channel during text pre-processing the value above is transformed into content with type 'SitecoreItem' and section name '__Editors' as follows:
SitecoreItem___Editors
4.2.3 Where Can Users Use Snippets?
Snippets can be used in 'pre' and 'post' processing. For more details see the Snippets List section.
Snippets can be used in the following places:
Replacement rules fields: Source Template, Replacement Template
Tag Rules fields: Name, Path, Condition, Translatable Attributes
4.2.4 How to Use Snippets?
Snippets are pre-packaged with all properties that are available for translation. We need a filter to know what properties to enable or what to disable.
We take value or section from available snippets and content with section identifiers. We can do this manually or use export setting and import setting features to add rules.
You can download settings from another channel for replacement from this link
The iLangl system inserts the file automatically for all content types. The file specifies string. At the start of string replacement template is added automatically.
The replacement is a macro, so a real Section Identifier is added, which is encoded for XML. Characters that are not compatible with XML are replaced with valid
XML strings during the replacement process. This improves the validity and reliability of encoded content, so system does not break during export or import process,
resulting in complete and accurate translation. When the system delivers the content back, it automatically remove the section ID.
4.2.5 Snippets List
Macro | Description | Export | Import |
---|---|---|---|
{contentid} | Primary identifier of the content | Yes | Yes |
{encodedcontentid} | Same like content Id but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{contentype} | Identifies the content type | Yes | Yes |
{encodedcontentype} | Same like content type but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{contensubtype} | Identifies the content sub type | ||
{encodedcontensubtype} | Same like content sub type but all invalid xml characters encoded to provide valid value for xml names | ||
{sourcelanguage} | Identifies source language of current request | Yes | Yes |
{encodedsourcelanguage} | Same like source language but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{targetlanguage} | Identifies target language of current request | No | Yes |
{encodedtargetlanguage} | Same like target language but all invalid xml characters encoded to provide valid value for xml names | No | Yes |
{sectionid} | Identifies section Id | Yes | Yes |
{encodedsectionid} | Same like section Id but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{sectiontype} | Identifies section type | Yes | Yes |
{encodedsectiontype} | Same like source type but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{sectionname} | Identifies section name | Yes | Yes |
{encodedsectionname} | Same like source name but all invalid xml characters encoded to provide valid value for xml names | Yes | Yes |
{spacebar} | Replaced by space. | Yes | Yes |