• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Template Syntax Inconsistency

James

Well-known member
#1
I didn't report this as a bug as it doesn't seem to be one.

In the account_avatar_overlay template, the avatar code is:
Code:
<img src="{xen:helper avatar, $visitor, l}" alt="{xen:phrase current_avatar}" />
In the member_card template, the avatar code is:
Code:
<img src="{xen:helper avatar, {$user}, l}" alt="" style="{xen:helper avatarCropCss, $user}" />
In the member_card template, curly brackets are used around the user variable, but they're not used around the visitor variable. Does this mean that the curly brackets aren't needed?
 

James

Well-known member
#5
Curlies are not always required when dealing with a strict variable reference, unless its construction is complex.

Yeah, it's complicated.
So in the above case, was its construction considered complex (the member_card template) or was it just how one of you guys were feeling at the time and decided to throw curlies in? ;)
 

Mike

XenForo developer
Staff member
#6
So in the above case, was its construction considered complex (the member_card template) or was it just how one of you guys were feeling at the time and decided to throw curlies in? ;)
It was written before the "simple" construction approach was available, most likely. :)