It is possible, through the Giotto language, to apply modifications to the formatting of text and numbers either if requested by users through specific configurable parameters, or when used to print values contained in specific contact fields.
Text
Name | Description |
---|---|
[param:text print='uppercase'] | Prints the text in uppercase. |
[param:text print='lowercase'] | Prints the text in lowercase. |
[param:text print='capitalize'] | Prints the first letter in uppercase. |
[param:text print='trim'] | Removes excess spaces at the beginning and end of a text. |
[param:text encode='encodehtml'] | Replaces special HTML characters with the equivalent XML entities. |
[param:text encode='encodejs'] | Replaces special JavaScript characters. |
[param:text encode='urlencode'] | Encodes the value as a URL parameter. |
[param:text print='md5'] | Transforms the text by applying an md5 encoding. |
[param:text print='sha1'] | Transforms the text by applying a sha1 encoding. |
[param:text print='sha256'] | Transforms the text by applying a sha256 encoding. |
[param:text print='sha512'] | Transforms the text by applying a sha512 encoding. |
[param:text print='base64' encoding='utf-8'] | Transforms the text by printing the base64 representation following the encoding indicated in the 'encoding' attribute. |
If you use base64, md5, sha1, sha256, sha512, the encoding parameter is also considered, in addition to the print one.
Specifying the "encoding" parameter allows you to use different types of encoding such as: "utf-8" (default), "utf-16", "windows-1252" or encoding special characters with 7-bit ASCII characters.
Examples:
- If you want to print a contact's name in uppercase or lowercase, apply the parameters print='uppercase' and 'lowercase':
<h1>[contact:name ]</h1>
<h1>[contact:name print='uppercase']</h1>
<h1>[contact:name print='lowercase']</h1>
- If you want to retain HTML characters, for example "< >" which identify the symbols <>, insert:
<h1>[param:test encode='encodehtml']</h1>
Without the encode='encodehtml' encoding, you will only see the less than and greater than symbols as "<>" instead of the HTML code. - If you want to print the contact's email in Base64:
<h1>[contact:email print='base64']</h1>
Numbers and dates
Name | Description |
---|---|
maxdigits | Number of decimal places forming the number. The use of maxdigits also implies rounding of the digits (from 0 to 5 the digit will be rounded down, otherwise up). |
pattern | Allows formatting of fields containing data of type date/time. |
"Pattern" parameter
Format the pattern parameter following these instructions:
- d: day of the month;
- dd: day of the month always represented with two digits;
- ddd: day of the month with a leading 0;
- dddd: day of the month with leading 00;
- EEE: day of the week abbreviated in letters;
- EEEE: day of the week spelled out in letters;
- M: month of the year;
- MM: month of the year always represented with two digits;
- MMM: month of the year abbreviated in letters;
- MMMM: month of the year spelled out in letters;
- yyyy: year;
- YYYY: current week's year (note: the last week of the year may return the next year);
- H: hour;
- HH: hour represented with two digits;
- m: minutes;
- mm: minutes always represented with two digits;
- s: seconds;
- ss: seconds always represented with two digits;
- h: hour (in am/pm format);
- a: adds the AM/PM marker;
- w: prints the week number of the year;
- z: prints the reference timezone;
- zzzz: prints the reference timezone in extended version.
Example of using a contact field of type date-time: Date and time [contact:DATETIMEFIELD pattern='dd/MM/yyyy HH:mm']