Re: Template Validation Failing

Anonymous
Not applicable

Template Validation Failing

I am building a guided template and when I try and validate my template I get the following error:

Template validation failed because of these errors: Error in variable declaration: invalid value for attribute default.

I am working in the code editor when I am working on this template. Sometimes when I make a mistake with a variable, the line get's highlighted in red. Right now, I cannot see any highlighted lines telling me where this error is.

In the code I have some meta elements to define the variables such as:

<meta class="mktoString" mktoName="Social: Title" id="socialTitle" default="Title for social sharing." />

<meta class="mktoString" mktoName="Social: Description" id="socialDescription"  default="">

<meta class="mktoImg" mktoName="Social: Image" id="socialImg" default="">

<meta class="mktoBoolean" mktoName="Page: Heading Hide / Show" id="pageHeadingHideShow" default="true" true_value="block" false_value="none" false_value_name="Hide" true_value_name="Show" />

<meta class="mktoString" mktoName="Page: Heading" id="pageHeading" default="">

<meta class="mktoColor" mktoName="Page: Heading Color" id="pageHeadingColor" default="ff6600" />

When I am trying to print out these variables I am doing so as:

<meta property="og:title" content="${socialTitle}" />

<meta property="og:description" content="${socialDescription}" />

<meta property="og:image" content="${socialImg}" />

<style>

#mktHeading {

    background-color: #${pageHeadingColor};

    display: ${pageHeadingHideShow};

}

</style>

<h1 id="mktHeading">${pageHeading}</h1>

According to documentation, I am doing it right (I hope).

Hoping to get some advice from others who might be able to point me in the right direction.

Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Template Validation Failing

I'm getting exactly the same issue, on templates that were approving fine yesterday...

EDIT:

Try this, add the attribute to a div and nest the h1 inside:

<div id="mktHeading"><h1>${pageHeading}</h1></div>

Justin_Cooperm2
Level 10

Re: Template Validation Failing

1. You don't need to close <meta> tags that are defining Marketo variables.

2. You are defining an incorrect variable...

<meta class="mktoImg" mktoName="Social: Image" id="socialImg" default="">

There is no such thing as a "mktoImg" variable. We only support String, Color, and Boolean variables.

You would specify an editable image element on a <div> or <img>

If you want to make the og image tag editable, you would use a string variable and then the user would enter the image URL into the variable area in the landing page editor.