How do I add an image instead of the rank text?

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

How do I add an image instead of the rank text?

Evildaddy
Here's the code so far
 <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_in_group group= 'Premium'/]" label="[t]Premium[/t]"/>
    <n.avatar_label condition="[n.owner.is_in_group group= 'AdBot'/]" label="[b][t]AdBot[/t][/b]"/>
    <n.avatar_label condition="[n.owner.is_in_group group= 'Registered Users'/]" label="[h2][b][t]Junior Member[/t][/b][/h2]"/>
    <n.avatar_label condition="[n.owner.is_in_group group= 'Moderator'/]" label="[h2][b][t]Moderator[/t][/b][/h2]"/>
    <n.avatar_label condition="[n.owner.is_in_group group= 'Members'/]" label="[h2][b][t]Member[/t][/b][/h2]"/>
    <n.avatar_label condition="[n.owner.is_site_admin/]" img src="http://s18.postimg.org/3tjy92bf9/Admin.png"/>
    <n.avatar_label condition="[n.owner.is_banned/]" label="[t]Banned User[/t]"/>
    <n.owner.post_count/>
</override_macro>

I would like an image to appear instead of Admin.
Reply | Threaded
Open this post in threaded view
|

Re: How do I add an image instead of the rank text?

Pedro <Nabble>
Edit your avatar_label macro like this:
<override_macro name="avatar_label" parameters="condition,img" dot_parameter="label" >
    <n.if.condition>
        <then>
            <div class="avatar-label weak-color"><n.label/></div>
            <img src="[n.img/]"/>
        </then>
    </n.if.condition>
</override_macro>
Now you can do this:
<n.avatar_label condition="[n.owner.is_site_admin/]" label='' img="http://s18.postimg.org/3tjy92bf9/Admin.png"/>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: How do I add an image instead of the rank text?

Evildaddy
Thank you so much, Pedro! Anything I can do to help you? I really appreciate your constant help.
Reply | Threaded
Open this post in threaded view
|

Re: How do I add an image instead of the rank text?

Pedro <Nabble>
You are welcome.
Yes, you can help me, we have users that help other users here. You can help them if you see any issue you know.

Thanks.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: How do I add an image instead of the rank text?

Lotte
Hi,
first post here, so plz go easy on me (I'm a natural blonde..)

I did exactly what you described (I used an url of an image I posted in a Nabble topic, but I just can't get things to work.
The problem is that all the forward slashes from the address seem gone. You can see so when you use "inspect" in Google Chrome.

it looks like this:


Can someone help me with this?
Thanks in advance,
Lotte :)

The code I've used:
<override_macro name="avatar_label" parameters="condition,img" dot_parameter="label" >  
    <n.if.condition>  
      <then>  
        <div class="avatar-label weak-color"><n.label/></div>  
        <img src="[n.img/]"/>  
      </then>  
    </n.if.condition>  
</override_macro>   

And:

<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/]" label="[b][t]Forum Hostess[/t][/b]"/>
    <n.avatar_label condition="[n.owner.is_site_admin/]" label='' img="http://lotte-s-secrets.216564.n8.nabble.com/file/n149/ForumHostessRANK2.png"/>
      <n.avatar_label condition="[n.owner.is_banned/]" label="[t]Banned User[/t]"/>
    <n.owner.post_count/>
</override_macro>


" Come on in. The water's fine.. "