[SalesForce] Guide Template Language blocks displayed in CloudPages

I can't figure out how to get GTL working on CloudPages. I was informed that it should work.

Here's my HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <title>GTL Test
      </title>
      </head>
    <body>
      %%[
      var @reservationData
      set @reservationData = '{"reservationId":"RXJ34P","passengerPriorityStatus":"Fast Track","passengerSequenceNumber":"ABC123","securityScreening":"TSA PreCheck"}'
      ]%%
      {{.datasource reservation type=variable}}
      {{.data}}
      { "target" : "@reservationData" }
      {{/data}}
      <p>Your reservation code is: {{reservationId}}
      </p>
      {{/datasource}}
    </body>
    </html>

Nothing special here. If I view the published page, I see the raw GTL datasource block:

rendered page

However, if I copy and paste the same HTML into an email, then preview the email, it displays correctly.

Does anyone know how to get GTL working in Cloud Pages?

Best Answer

It turns out that GTL is supported in CloudPages and Landing Pages after all. However, you need to reset the GTL delimiters by placing the following line at the top of your content: %%{={{ }}=}%%

So the page will look like this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <title>GTL Test
      </title>
      </head>
    <body>
      %%[
      var @reservationData
      set @reservationData = '{"reservationId":"RXJ34P","passengerPriorityStatus":"Fast Track","passengerSequenceNumber":"ABC123","securityScreening":"TSA PreCheck"}'
      ]%%

      %%{={{ }}=}%%

      {{.datasource reservation type=variable}}
      {{.data}}
      { "target" : "@reservationData" }
      {{/data}}
      <p>Your reservation code is: {{reservationId}}
      </p>
      {{/datasource}}
    </body>
    </html>
Related Topic