Forum Discussion

FlorianS's avatar
FlorianS
Mentor
13 years ago
Solved

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 :

 

badge.JPG

 

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.

2 Replies

  • KaelaC's avatar
    KaelaC
    Lithium Alumni (Retired)
    13 years ago

    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.

  • FlorianS's avatar
    FlorianS
    Mentor
    13 years ago

    Hi KaelaC,

    That's Perfect ! Thanks very much.

    Have a nice day.

     

    Florian