Fuhrmann
Well-known member
Helpers provide extra functions that you can use inside the XenForo templates.
Currently there are many Helpers, following some them:
avatar -> Helper to fetch the URL of a user's avatar.
username -> Produces a <a href="members/username.123" class="username">Username</a> snippet.
usertitle -> Helper to get the user title for the specified user.
richusername -> Outputs the necessary HTML for a rich username (includes the display style markup class).
ismemberof -> Check if the user is member of a group.
wordtrim -> Word trims and HTML escapes the given string.
autolink -> Auto-links URLs in plain text. This text should generally already be HTML escaped, because it can't be done after the linking.
You can call a helper in the template this way:
So, but what if we want to use a custom template helper?
Currently there are many Helpers, following some them:
avatar -> Helper to fetch the URL of a user's avatar.
username -> Produces a <a href="members/username.123" class="username">Username</a> snippet.
usertitle -> Helper to get the user title for the specified user.
richusername -> Outputs the necessary HTML for a rich username (includes the display style markup class).
ismemberof -> Check if the user is member of a group.
wordtrim -> Word trims and HTML escapes the given string.
autolink -> Auto-links URLs in plain text. This text should generally already be HTML escaped, because it can't be done after the linking.
You can call a helper in the template this way:
Code:
{xen:helper NAME_OF_THE_HELPER, 'argument1', 'argument2'}
So, but what if we want to use a custom template helper?