FlorianS
13 years agoMentor
Add an image in the author information in the message view
Hi,
I have create a custom component using context object that displays a specific image regarding the role of the author :
<#assign user_has_role = false /> <#if page.name == "ViewProfilePage"> <#list restadmin("/users/id/${page.context.user.id}/roles").roles.role as role> <#if role.name?? && (role.name == "Moderator")> <#assign user_has_role = true /> </#if> </#list> <#elseif env.context.message?? && env.context.message.author.id??> <#list restadmin("/users/id/${env.context.message.author.id}/roles").roles.role as role> <#if role.name?? && (role.name == "Moderator")> <#assign user_has_role = true /> </#if> </#list> </#if> <#if user_has_role?? && user_has_role == true> <img id="display_badge" src="/html/assets/badge-moderateur.png"/> </#if>
But I want this <img> to be inserted into the message-author, right here :
How can do that ?
Thank for your help.
Kind regards,
Florian
You will want to add your component to the Forum Message page below the 'author' component in the 'main-left' column. Let me know if that placement isn't perfect. The author component is a collection of a bunch of other components. You can break it up if need be.