Introduction / FirstSpirit ServerManager / Server properties / Conversion rules

Conversion rules

Conversion rules

This is where the server conversion rules are defined.

The conversion rules defined here can be selected from a drop-down list

The “Convert HTML” conversion rule is provided by default with the following content:

[convert]

0x3c="<"
0x3e=">"
0x22="&#34;"
0x26="&"
0x27="&#39;"

Conversion rules are used to convert characters that are input. You can either:

  • swap one character for another or
  • swap a character for a string

A conversion rule consists of two areas:

  • convert: [convert] ensures that any non-HTML-conformant characters are replaced by ones that are HTML conformant. The .convert method can be called in the presentation channel (e.g., the HTML channel) and/or in a format template.
    The character to be replaced can be entered by hexadecimal Unicode value or directly by keyboard.
  • quote: Use [quote] to quote HTML- or XML-specific characters as well. Care should be taken to ensure that the following characters are quoted – as a minimum – or that they are included in the conversion rule used (for the presentation channel): <, >, ', " (see Security (→FirstSpirit Online Documentation)).

Example: Using a conversion rule within a format template
1) Definition of a conversion rule (“test”):

[convert]
0x21="an exclamation mark"
0x23=0x24
[quote]
0x25=0x22

0x21: exclamation mark (!)
0x22: quote mark (")
0x23: hash character (#)
0x24: dollar character ($)
0x25: percent character (%)

2) Using the conversion rule “test” within the project (format template):

<pre>
convert: $CMS_VALUE(":::!:::#:::%:::".convert("test"))$
convert2: $CMS_VALUE(":::!:::#:::%:::".convert2("test"))$
</pre>

3) Result of the conversion “test” within the project (output channel):

convert:  :::an exclamation mark:::$:::%:::
convert2: :::an exclamation mark:::$:::":::

Add: New conversion rules need to have been added in advance as a text file. With “Add”, a selection dialog opens in which the local computer file structure can be searched.

Important The text file must be in UTF-8 format. Uploading files with other encodings is not recommended and may cause problems.

Edit: The “Edit conversion rule” dialog is used to edit an existing conversion rule.

Delete: Clicking on this button lets the user remove existing conversion rules from the server. A confirmation prompt appears before deletion.

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.13 | Data privacy