Avatar element
4 posters
Page 1 of 1
Avatar element
Hello,
I think most of you are familiar with the { USERNAME } element, I think it's an element but I will just call it that in this topic.
I was wondering if there is also a possiblity to do this with the avatar? I've seen it on other forums but I can't find the right element. I also don't know if it has to look something like: <img src="{USER_AVATAR}"> or something like that?
Hopefully someone can help me!
Greetings,
Hert
I think most of you are familiar with the { USERNAME } element, I think it's an element but I will just call it that in this topic.
I was wondering if there is also a possiblity to do this with the avatar? I've seen it on other forums but I can't find the right element. I also don't know if it has to look something like: <img src="{USER_AVATAR}"> or something like that?
Hopefully someone can help me!
Greetings,
Hert
Re: Avatar element
What are you trying to with the avatar element?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Avatar element
I actually want to recreate the login widget, so I can customize it (:
I've already found out how I can make a login one, but I don't know how to make a status one - since I don't have the avatar element sadly.
Hopefully this anwsers your question (:
I've already found out how I can make a login one, but I don't know how to make a status one - since I don't have the avatar element sadly.
Hopefully this anwsers your question (:
Re: Avatar element
Status and avatar are two completely different things.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Avatar element
Okay I decided to make some images, because appearently I can't explain things.
Normally you have this widget, the login widget, and when you login you get this status thing:
Now what I want out of this widget is the element that is used for this, the avatar, so I can recreate it in my own widget and personalize it:
I really don't know how to make it any clearer, really. So hopefully it's understandable now.
Normally you have this widget, the login widget, and when you login you get this status thing:
- Spoiler:
Now what I want out of this widget is the element that is used for this, the avatar, so I can recreate it in my own widget and personalize it:
- Spoiler:
I really don't know how to make it any clearer, really. So hopefully it's understandable now.
Re: Avatar element
It isn't working, or I'm doing something wrong.
I've tried just putting it in the widget and in the code <img src="{L_AVATAR_IMG}"> but neither seem to work for some reason.
I've tried just putting it in the widget and in the code <img src="{L_AVATAR_IMG}"> but neither seem to work for some reason.
Re: Avatar element
Hi @Hert
The one that you're looking for should be this : https://github.com/Etana/template/blob/master/var/USERNAME_AVATAR.md#readme
However, this variable is only applicable to the templates. ( Templates > Portal > mod_login, for example ) You can find a complete template variable list here, however note that the majority is in French.
If you want to achieve this outside the templates, I would recommend placing this where HTML ( and <script> ) formats. Such as a widget, HTML page, or homepage message.
The one that you're looking for should be this : https://github.com/Etana/template/blob/master/var/USERNAME_AVATAR.md#readme
However, this variable is only applicable to the templates. ( Templates > Portal > mod_login, for example ) You can find a complete template variable list here, however note that the majority is in French.
If you want to achieve this outside the templates, I would recommend placing this where HTML ( and <script> ) formats. Such as a widget, HTML page, or homepage message.
- Code:
<script type="text/javascript">document.write(_userdata.avatar)</script>
Re: Avatar element
I thinking that working in the template is going to work better, but the problem I'm facing now is that nothing seems to work on the avatar. I want to change the size a bit, make it - for example - 50px by 50px. I've tried by adding a class to the div but it ignores it.
I've even tried putting in seperate hight and width properties and even with a style part in the div code, but it just ignores it completely.
I know it can be done, I've seen it on another forum. I've also tried using the script in my own widget - but that ignores it aswell.
The code I found in the template that I'm focusing on is this one:
I'm sorry if my explanation might seem a bit vague, but I'm not that good at it ^^'
I've even tried putting in seperate hight and width properties and even with a style part in the div code, but it just ignores it completely.
I know it can be done, I've seen it on another forum. I've also tried using the script in my own widget - but that ignores it aswell.
The code I found in the template that I'm focusing on is this one:
- Code:
<div style="float:{DIRECTION};">{USERNAME_AVATAR}</div>
I'm sorry if my explanation might seem a bit vague, but I'm not that good at it ^^'
Re: Avatar element
Are you publishing the template after saving the changes?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Avatar element
Have you tried using the option in the avatar section to set the size?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Avatar element
That won't work. I've put it at 150x200 pixels, because I like that size on the normal forum etc.
But in the widget I just want it to be a little bit smaller because it looks too big otherwise.
But in the widget I just want it to be a little bit smaller because it looks too big otherwise.
Re: Avatar element
It appeared to be working for me by making the addition. You added a class and then proceeded to make modifications via CSS, correct ? This is what I used and it worked correctly.
HTML :
CSS :
The only other thing I can think of was were you changing the DIV's style via CSS instead of selecting IMG inside your container ?
HTML :
- Code:
<div class="faAvatar">{USERNAME_AVATAR}</div>
CSS :
- Code:
.faAvatar img { width:50px }
The only other thing I can think of was were you changing the DIV's style via CSS instead of selecting IMG inside your container ?
Re: Avatar element
I did it similiar to that, yes, but forgot the img part in the CSS code - so now it works!
Thank you!
I was, however, wondering if you could use the {USERNAME_AVATAR} as a background image or something, because the changing in width and height could result in making the avatar look stretched out etc.
Thank you!
I was, however, wondering if you could use the {USERNAME_AVATAR} as a background image or something, because the changing in width and height could result in making the avatar look stretched out etc.
Re: Avatar element
If you're adjusting both the height AND width, it will cause some deformation. I'd recommend only adjusting the width to the maximum value you want, since width normally induces horizontal overflow ( scrollbar ) which isn't a desirable result.Hert wrote:I did it similiar to that, yes, but forgot the img part in the CSS code - so now it works!
Thank you!
I was, however, wondering if you could use the {USERNAME_AVATAR} as a background image or something, because the changing in width and height could result in making the avatar look stretched out etc.
If you want to cut the image off, I'd recommend a setup similar to this ( uses the container class from my example ) :
- Code:
.faAvatar {
height:100px;
width:100px;
overflow:hidden; /* clips image */
}
Setting the overflow to hidden will effectively clip the image if it exceeds the specified width and height.
Re: Avatar element
Well I tried it with only adjusting the width, but since most people just a 150x200 pixel avatar and I wanted to make a 100x100 one in the widget I couldn't just only adjust the width for the height would still be too long (:
But the clipping worked, thank you very much!
It's solved now ^^
But the clipping worked, thank you very much!
It's solved now ^^
Similar topics
» In what template I can add html element..
» Opacity of element
» Fitting an element in the announcements
» Help overriding element.style
» removing some element in post profile
» Opacity of element
» Fitting an element in the announcements
» Help overriding element.style
» removing some element in post profile
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum