Re: Need Help - Setting variable for landing page preview image IN EDITOR

Nick_Mignacca1
Level 1

Need Help - Setting variable for landing page preview image IN EDITOR

Hello everyone,

I'm putting together a universal template for our content landing pages and want to be able to set a preview image variable for the page in the editor (as you would for say your banner).  Can it be done?

We have managed to set a specific preview image in the template using the following code:

<meta property="og:image" content="http://portals.keanewzealand.com/rs/836-JGU-553/images/kea-connect-preview.png">

What we would however want is something along the lines of this (which doesn't work):

  <head>

    <meta charset="utf-8">

    <title>Landing Page</title>

    <link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900" rel="stylesheet">

    <meta name="author" content="">

    <meta name="keywords" content="">

    <meta name="description" content="">

    <meta property="og:image" content="{previewImg}">

    <meta property="og:type" content="website">

    <link rel="icon" type="image/x-icon" href="http://portals.keanewzealand.com/rs/836-JGU-553/images/favicon.ico">

    <link rel="icon" type="image/png" href="http://portals.keanewzealand.com/rs/836-JGU-553/images/favicon-32x32.png" sizes="32x32" />

    <link rel="icon" type="image/png" href="http://portals.keanewzealand.com/rs/836-JGU-553/images/favicon-16x16.png" sizes="16x16" />

   

    <!-- Marketo Variable Definitions -->

    <meta class="mktoString" id="logoLink" mktoName="Logo Link" default="https://www.keanewzealand.com/">

    <meta class="mktoString" id="previewImg" mktoName="Page Preview Image" default="http://portals.keanewzealand.com/rs/836-JGU-553/images/bannerBG.jpg">

Any help would be much welcome.

I am not a developer but I'm figuring out things as we go.  If we were able to do this sort of thing in the editor, it would both save the team having to mess around with coding, and allow us to have one universal template for most of our content.

Thanks

Nick

3 REPLIES 3
Nick_Mignacca1
Level 1

Re: Need Help - Setting variable for landing page preview image IN EDITOR

Is this something that you're familiar with Sanford Whiteman​?

SanfordWhiteman
Level 10 - Community Moderator

Re: Need Help - Setting variable for landing page preview image IN EDITOR

Is this something that you're familiar with Sanford Whiteman?

Yep, you don't have to tag me, though.  Lotsa people here know about variables, and I'm always watching anyway.

Marketo variables use dollar-mustache syntax:

${variable}

Here you've just used mustache.

Nick_Mignacca1
Level 1

Re: Need Help - Setting variable for landing page preview image IN EDITOR

Wonderful, again thank you very much. 

I can't believe I'd gotten that close.

Nick