Re: Email Number variable not defined

Anonymous
Not applicable

Email Number variable not defined

I have the following code with two number variables; one for the the top table cell and one for the bottom table cell.

I am getting an error saying the second number variable is not defined.

Error: Variable Not Defined: articleSectionSpacer2

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>

<!-- Marketo Variable Definitions -->

<meta class="mktoNumber" id="articleSectionSpacer1" mktoName="Article heading top spacer" default="30">

<meta class="mktoNumber" id="articleSectionSpacer2" mktoName="Article heading bottom spacer" default="30">

</head>

<body class="body">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

    <td height="${articleSectionSpacer1}"></td>

  </tr>

  <tr>

    <td>

      Article section heading

    </td>

  </tr>

  <tr>

    <td height="${articleSectionSpacer2}"></td>

  </tr>

</table>

</body>

</html>

Have I missed anything. I can't figure out why I'm getting this error.

Thanks

13 REPLIES 13
Grégoire_Miche2
Level 10

Re: Email Number variable not defined

Hi Matt,

Everything seems to be OK.

Can you provide a screenshot with the error showing up?

-Greg

Anonymous
Not applicable

Re: Email Number variable not defined

Hi Greg,

I changed my variable names to see if that corrected the issues, unfortunately not.

This is the error message if I validate the html:

“Error: Variable Not Defined: articleSpacerBottom

Error: Variable Not Defined: articleSpacerTop

Error: Variable Not Defined: articleSectionSpacerBottom

Error: Variable Not Defined: separatorSpacerTop”

If I approve I get a different error:

“Variable Not Defined: articleSpacerBottom”

I’ve been building out these templates using a task runner, where the primary task is to inline all external css to the html file and then also apply the styles inline to each element with in the document.

If I create a separate template and author the variables and markup within the template editor I don’t get an issues.

<html>

  <head>

    <meta class="mktoNumber" id="bannerSpacerTop" mktoname="Banner top spacer" default="30" min="10" max="60" step="10">

    <meta class="mktoBoolean" id="alignHeader" mktoname="Center logo" default="false" false_value="left" true_value="center" false_value_name="Left" true_value_name="Centered">

    <meta class="mktoNumber" id="bannerSpacerBottom" mktoname="Banner spacer bottom" default="30" min="10" max="60" step="10">

    <meta class="mktoNumber" id="sectionSpacerTop" mktoname="spacer spacer top" default="30" min="0" max="30" step="5">

    <meta class="mktoNumber" id="spacerSpacerBottom" mktoname="spacer spacer bottom" default="30" min="0" max="30" step="5">

  </head>

  <body>

    <table width="100%" cellspacing="0" cellpadding="0" border="0">

      <tbody>

        <tr>

          <td height="${bannerSpacerTop}"></td>

        </tr>

        <tr>

          <td align="${alignHeader}">A heading</td>

        </tr>

        <tr>

          <td height="${bannerSpacerBottom}"></td>

        </tr>

        <tr>

          <td height="${sectionSpacerTop}"></td>

        </tr>

        <tr>

          <td>

            <hr></td>

        </tr>

        <tr>

          <td height="${spacerSpacerBottom}"></td>

        </tr>

        <tr>

          <td>Some more text</td>

        </tr>

      </tbody>

    </table> 

  </body>

</html>

Marketo works fine with another variable type, it just seems to have an issue with multiple number variable.

Can I send you the build output code to see if you can see an issue?

Thanks

Matt

Grégoire_Miche2
Level 10

Re: Email Number variable not defined

Justin Cooperman​, may be you will be able to see something that we are missing

-Greg

Anonymous
Not applicable

Re: Email Number variable not defined

Somehow this has corrected itself.

The only change I made was to order the number variable declarations alphabetically., Other than that there was no other change to the code.

Thanks for your help all the same.

Grégoire_Miche2
Level 10

Re: Email Number variable not defined

You are welcome

-Greg

Justin_Cooperm2
Level 10

Re: Email Number variable not defined

It worked for me on the first try. Here's what I will say I have seen. If you have deleted tons of code and then pasted in your own, give the editor 4-5 seconds to re-parse everything before clicking "Approve"

I've seen weird cases where if you are deleting and pasting things around too quickly, it causes some issues.

Justin

Anonymous
Not applicable

Re: Email Number variable not defined

Thanks Justin — this was helpful. I have just been fighting with the issue for a couple of hours thinking that the validation errors it was throwing me were accurate.

In my case I actually had to let the editor sit for about 2-3 minutes before it would work.. this is on a 50kb template. I think this really should be addressed, or at least the error reporting improved, because it is hugely frustrating and a big time drain.

Edit: Scratch that, it worked once, but now won't work again. I am pulling my hair out here.

Here is a screenshot showing the validation errors it's throwing, and my defined variables in the background:

Screen-Shot-2016-07-29-at-5.46.25-PM.jpg

Anonymous
Not applicable

Re: Email Number variable not defined

I'm continuing to dig into this. It seems to be related exclusively to the use of the mktoNumber variable. When I remove that, and its associated element, my template saves.

Justin_Cooperm2
Level 10

Re: Email Number variable not defined

hmm, I can't reproduce this. Can you approve the template? I wasn't even clicking "Validate HTML". Please file a support ticket so we can have the right eyes on this