XF 2.0 Simple: How to show current year within a phrase

sandnes

Member
I'm brand new to XenForo coming from vBulletin, and I'm having a real hard time (for some reason) with phrases, when I was a bit of a whiz at them on VB. So please be gentle with me, and I'll start small.

If I want to put "©2018 ABCXYZ" at the bottom of my forum, I can/will use the "extra_copyright" phrase because it's set up for that purpose.
Great. That's fine and I've got it working.

What I want, though, is NOT to hard-code the year, and instead have it use the system current year, as in (I believe) 'date('Y');'

What goes in the phrase, then? I've tried © {{ date('Y'); }} ABCXYZ but the date isn't parsed. (Tried single curly braces too.)

PS It took me a while to figure out that all the <xen: codes I was seeing bandied about were not compatible with 2.0!
 
In your template, call
{{phrase('your_phrase', {'date' : date('Y')})}}

Change the phrase to
© {date} ABCXYZ
 
(It also gives me server errors.)

Thank you @S Thomas , but I was unable to get that to give me the desired result. Can anyone else suggest an answer?
Well, I just took your input in blindly. Obviously, it would've been a help if you actually posted the error.

{{phrase('your_phrase', {'date' : date($xf.time, 'Y')})}}

=>

© 2018 ABCXYZ
 
Top Bottom