Landing Page Template error - tip

Anonymous
Not applicable

Landing Page Template error - tip

Hi,

Since the landing page templates are html, css and javascript code, I like to pretty print it so it is readable and maintainable.  However, if I
  1. open a template
  2. copy and paste the code into Brackets (Adobe's open source web code editor)
  3. run the Beautify extension
  4. copy the nicely laid out code
  5. select the code in the MKTO template editor and delete it, and
  6. paste in the beautified code...

MKTO tries to auto save and says "error".  Nothing useful or in any way helpful, just "error."  Its the same exact code just beautified.  I did figure out the source of the error.

MKTO seems to check the php fragments to see if they've been touched.  The Beautify extension for Brackets added a space after the [ turning this:

  <?php echo $mContext['bodyAttributes'] ?>

into this:

  <?php echo $mContext[ 'bodyAttributes'] ?>

I'm not a php'er but I doubt that would affect the php code.  So if the landing page template editor gives you 'error' after you paste some code in check the php fragments to make sure they are exactly what MKTO wrote.
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Landing Page Template error - tip

HUGE thank you for posting this tip! Saved me hours of frustration. I did the exact same thing - used the HTML/CSS/JS Prettify extension in Sublime Text to reformat the code and it added those extra spaces to the PHP which was throwing the error. Removed the spaces and it works lke a charm! Cheers!
Anonymous
Not applicable

Re: Landing Page Template error - tip

You're most welcome!