SOLVED

Re: Error Syntax Template (which line!?!)

Go to solution
Anonymous
Not applicable

Error Syntax Template (which line!?!)

If I am copying and pasting in my local template design and Marketo throws the "Validation Error" how the !@*& am I supposed to know what line that error is on? This is driving me insane trying to debug this thing.

Whats even more insane is I will comment out a line I think might be throwing the flag, and the validation clears. Then I will uncomment, and get the error. Then I will comment out again that *same* line and get the error again whereas it cleared the first time!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Error Syntax Template (which line!?!)

No color picker for you, maybe. 

View solution in original post

12 REPLIES 12
Grégoire_Miche2
Level 10

Re: Error Syntax Template (which line!?!)

Hi Douglax,

Have you tried the "validate HTML" in the menu ?

-Greg

Anonymous
Not applicable

Re: Error Syntax Template (which line!?!)

You mean "Validate Syntax" in the marketo menu? That's what is throwing the error, along with trying to approve and close the editing template window. The problem is it doesn't say what line the error is on, and with a LP template with over 1000 lines of code and 60 lines of marketo variable tags, it's a little difficult to locate exactly what is causing the error.

I just got another error for unique ID tags and that one actually highlighted the error (to my delight!) The issue must be with the error type. If I get the error:

pastedImage_0.png

There is no code highlighted showing where the variable declaration error is. I finally figured out that it was where I was trying to use "RGBA(255,255,255,0)". I debugged by commenting out line by line default marketo meta variables until I got a clean validation. Related to this question here.  Unfortunately, it looks like RGBA(255,255,255,0) doesn't work...

Anonymous
Not applicable

Re: Error Syntax Template (which line!?!)

As an added pain, you have to wait a hot second for marketo to auto-save before validating. If you deleting the offending line and immediately hit validate, your still gonna get the error, making debugging even more challenging. I think this is why I was getting the early issue mentioned in the initial post:

"Whats even more insane is I will comment out a line I think might be throwing the flag, and the validation clears. Then I will uncomment, and get the error. Then I will comment out again that *same* line and get the error again whereas it cleared the first time!"

Grégoire_Miche2
Level 10

Re: Error Syntax Template (which line!?!)

Hi Douglas,

the fact that it takes a couple of seconds is because Marketo has to save your draft before it can validate it. When you hit the validate button too quickly, it is fact validating the previous version.

-Greg

Grégoire_Miche2
Level 10

Re: Error Syntax Template (which line!?!)

OK, got it. The <meta> variable declaration is the culprit.

We usually set the opacity with 2 variables. One is the color itself. The second is for the opacity and can be a toggle (that will render 0.5 if on and 1 if off) or a picklist that will render a few values between 0.1 and 1.

The CSS will look like this:

.banner-sec{

  background-image: url('${banner-bg}');

  background-color:${Banner-BG-Color};

  display:${showBanner};

}

.banner-sec:before {

  background-color: rgba(0,0,0,${banner-opacity});   

}

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Error Syntax Template (which line!?!)

But Greg, if you look at my example in the related thread, setting rgba as the default works in my simple test. Something's not being communicated right, I think.

Grégoire_Miche2
Level 10

Re: Error Syntax Template (which line!?!)

Hi Sanford,

On the other thread, you are using a mktoString Variable. Here I am using a mktoColor. And my understanding is that Douglas is having issues with the RGBA in a mktoColor.

Now I fully agree that the mktoString solution is probably the simpler one , but then, no color picker.

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Error Syntax Template (which line!?!)

No color picker for you, maybe. 

Grégoire_Miche2
Level 10

Re: Error Syntax Template (which line!?!)

Alas