Last Poster Avatar Variable in Forum Row

Aug 31 2020, 03:05 PM

<!-- |last_poster_avatar| --> <!-- |last_poster_avatar_url| --> variables are now available in Forum Row templates.

This is a small update, but we're making it an announcement because so many are already using a work-around to get this feature. A common implementation of this is usually the following:

/* don't use this! */

background-image: url('path//av-ID.png'), url(''path///av-ID.gif'), url(''path//av-ID.jpg'), url(''path///av-ID.jpeg'), url('default');

While this method works, it has two major downsides:

1. It has to try multiple image requests until it reaches the correct one! This can waste browser requests.

2. You cannot allow URL avatars, uploaded avatars are required! Free and premium service, while allowing generous space, have limits.

The variable(s) addresses both issues so you can simply use the following:

background-image: url('<!-- |last_poster_avatar_url| -->');

If you want need to set a default avatar for the url variable, a new macro has also been created called <{AVATAR_URL}> or you are welcome to put the default avatar url at the end as a second request since it defaults to a null url.

Let us know if you experience any problems using this new feature! We'll look into extending this into the topic rows as well, if possible, in the future.

Best regards,

John & the JFH Team


No comments have been made yet on this article