Getting Started With Content Blocks: Header Content Block

A branded header (plantopia-1-header) Content Block could look like following:

What’s included

  • Logo + brand name — Displays the Plantopia logo together with the brand name to ensure immediate brand recognition.
  • Web version link — Visible in emails but hidden on web pages, allowing the same Content Block to function correctly in both environments.
Copy
  <sg:conditional expression="eq([SYSTEM.MAIL],'1')">
   <a href="[%LINK(0)%]" data-link="webversion">Webversion</a>
  </sg:conditional>&nbsp;

Whilst the above code works, it uses older Campaign syntax, which is not guaranteed to be future proof. Using a Selligent expression is probably safer:

Copy
<sg:conditional expression="eq(tobool(InWebContext()),tobool('false'))">
 <a href="[%LINK(0)%]" data-link="webversion">Webversion</a>
</sg:conditional>&nbsp;

For that reason, it is recommended to update any older expressions where they are encountered.

How translation works

The Web Version link text can be automatically translated using a dictionary, based on the recipient’s language.

Copy
 <sg:conditional expression="eq([SYSTEM.MAIL],'1')">
 <!-- ##################################################################
 This relies upon a dictionary being defined 
 - the name of the dictionary is "TRANSLATIONS", with a CODE of "WEBVERSION"
  ... which contains the different translations of "Read Online"
 ################################################################## -->
 <a href="[%LINK(0)%]" data-link="webversion">%label( 'TRANSLATIONS','WEBVERSION' )%]</a>
 </sg:conditional>

Copy tips

  • Keep the label short — Examples: View in browser, Voir en ligne, Im Browser ansehen.
  • Use a high-contrast logo and always include alt text (e.g., Plantopia) to support accessibility and improve rendering when images are blocked.