Can't parse current_time inside a variable!
I'm having a strange one. I've created a variable that looks like this:
© Copyright 2003 - {current_time format="%Y"} xxxx. All rights reserved. Site by Pepper Digital.
It's called lv_footer_copyright, and as things go it's pretty simple.
When I use it as {exp:low_variables:single var="lv_footer_copyright"}, it outputs as is. The time isn't parsed. I've set to early parsing, still the same. It is inside a snippet which I thought might be the problem, but outside of a snippet it's still the same.
It's a strange one, I figure this should be fairly standard?
Replies
Low 22 May 2012 12:36
Hey Andy,
Not so strange, but Parse Order all over again. :)
{current_time} actually is parsed early (but after "normal" early parsed vars). So, using the template tag, which parses at stage #5 according to my pdf, won't work, 'cause the {current_time} var has already been processed.
Solution: use the simple variable syntax instead of the template tag: {lv_footer_copyright}, and make sure Early Parsing is enabled.
andyharris 22 May 2012 13:30
That's got it, but doesn't work inside a snippet - which I guess is as expected if I understand the order correctly (which I perhaps don't yet, but will!)
Thanks!
Low 22 May 2012 13:35
If you change the Snippet to an Early Parsed LV, and make sure both vars are in the same Variable Group, and you make sure the snippet is displayed above the lv_footer_copyright var, then it should work.
Early parsed LVs can be nested, depending on the order in their group.
andyharris 22 May 2012 13:36
OK, great. I think I need to give some time to fully understanding this - and I wish those guys at Mountee would add LV support!!
Cheers Low.