Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • {% exp 2 == 2 %} wird zu True

  • {% exp String.toupper(Value) %} wird zu ENCODO bei Value = Encodo

🖼️ Bilder

Um Bilder in HTML-Templates darzustellen, steht der Filter image zur Verfügung.

Einfaches Bild

{{ Stream | image type: 'image/svg+xml' }}

Bild mit “alt” Text

{{ Stream | image type: 'image/svg+xml' alt: 'Logo' }}

Bild mit “alt” Text und Grösse

{{ Stream | image type: 'image/svg+xml' alt: 'Logo' width: '200' height: '100' }}

Damit das Bild korrekt dargestellt werden kann, muss zwingend der Media-Type angegeben werden.

Übersicht über verschiedene Media-Types: https://wiki.selfhtml.org/wiki/MIME-Type/%C3%9Cbersicht#I

Markdown to Html

Um Markdown-Inhalte eines Felds zu Html zu konvertieren, steht der Filter markdown_to_html zur Verfügung.

Beispiel:

  • {{ MyMarkdownField | markdown_to_html }}

➡️ Migration von Templates

...

Bestehendes Template

Liquid Template

Code Block
Hi {{Object.FirstName}} {{Object.LastName}}
 
This is an e-mail template with some lead-in text and then some blocks.
 
[[List: Source="Company.Offices"]]
[[Header]]
ListHeader:
[[/Header]]
[[Detail VisibleIf="1==1"]]
{{Item.Name}}
[[/Detail]]
[[Detail VisibleIf="1==2"]]
Not visible
[[/Detail]]
[[Footer]]
ListFooter
[[/Footer]]
[[/List]]
 
Thanks & Greets
 
{{Company.Name}}
Code Block
Hi {{ FirstName }} {{ LastName }}
 
This is an e-mail template with some lead-in text and then some blocks.

{% if Company.Offices.size > 0 %}
ListHeader:
{% for office in Company.Offices %}
{% if 1 == 1 %}
{{ office.Name }}
{% endif %}
{% if 1 == 2 %}
Not visible
{% endif %}
{% endfor %}
ListFooter
{% endif %}

Thanks & Greets
 
{{ Company.Name }}