Change Admin text under avatar

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Change Admin text under avatar

Rizzo
Hello, I wanted to know how to use under my avatar instead of the word "Administrator" here

I've managed to add user ranks by searching this forum but I'm completely stuck with this, nothing I've tried seems to work
Any help would be appreciated
Reply | Threaded
Open this post in threaded view
|

Re: Change Admin text under avatar

GregChapman
I have just tried making this macro edit and, without testing thoroughly, it appears to work:

 <override_macro name="avatar_label" parameters="condition" dot_parameter="label">
    <n.if.condition>
        <then>
            <div class="avatar-label weak-color"><img src="http://support.nabble.com/file/n7601206/admin-1.png"/></div>
        </then>
    </n.if.condition>
</override_macro> 

Note: I just used the URL of the image in your post to replace the code
<n.label/>
in the original macro. What I did is extremely crude as, should you have any banned users, they'll come up with the Administrator image as well. The trouble is I'm not confident of my ability to write the if/then code to make sure it displays "Banned User" when it should!

If you can work out how to do that, let me know!

Also, as the avatars are only 100px wide, I reckon your image is over-large for the space available!
Volunteer Helper - but recommending that users move off the platform!
Once the admin for GregHelp now deleted.
Reply | Threaded
Open this post in threaded view
|

Re: Change Admin text under avatar

Rizzo
Thanks for that



I added width="140px" height="30px" to your code and it seems to be okay. I'm just trying to figure out how to remove it from the banned users now, if I work it out I'll let you know.....
Reply | Threaded
Open this post in threaded view
|

Re: Change Admin text under avatar

Mencey Melgar
Hello,

In order to use a custom avatar you should edit the avatar_label macro to accept img paramenter:
<override_macro name="avatar_label" parameters="condition,img" dot_parameter="label">
    <n.if.condition>
        <then>
            <img src="[n.img/]"/>
        </then>
    </n.if.condition>
</override_macro>

Then, you have to set the img from classic_big_avatar_cell:
<override_macro name="classic_big_avatar_cell" requires="node">
    <div class="avatar-outer">
        <div class="avatar-inner">
            <n.owner.avatar size="big" border_class="medium-border-color"/>
        </div>
    </div>
    <n.avatar_label condition="[n.owner.is_site_admin/]" img="http://support.nabble.com/file/n7601206/admin-1.png" label=""/>
    <n.avatar_label condition="[n.owner.is_banned/]" img="banned image path" label=""/>
    <n.owner.post_count/>
</override_macro>
:) Helper
Reply | Threaded
Open this post in threaded view
|

Re: Change Admin text under avatar

Rizzo
Thank you Mencey Melgar,
I would never have worked out how to do that, I must have tried for at least 6 hrs. but got nowhere with it .....
I added a banned user image and it works great