Attention: The Marketo Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.

Error in template editor when trying to save PHP changes?

Anonymous
Not applicable

Error in template editor when trying to save PHP changes?

I wanted to change my copyright 2012 to a simple PHP copyright <? print(Date("Y")); ?>, but when I try to do so in the template editor, it errors trying to save. Multiple times. If I change 2012 to 2013 it saves fine, but that just puts off the problem for a year.

Anyone else seen an issue where adding PHP to a template causes it to error out saving? Were you able to get around it?
Tags (1)
3 REPLIES 3
Jep_Castelein2
Level 10

Re: Error in template editor when trying to save PHP changes?

You can't add PHP to a template. There are a couple of system PHP includes, but you can't add your own. 
Anonymous
Not applicable

Re: Error in template editor when trying to save PHP changes?

For this case, Javascript might work pretty well though.
Anonymous
Not applicable

Re: Error in template editor when trying to save PHP changes?

Use Javascript, here's the code you need: https://gist.github.com/longjasonm/4658095