Support Forum
The avatar size is handled by a max-width rule in the forum admin menu, so you can change that in Forum > Profiles > Avatars > Maximum Avatar Display Width (Pixels)..
This will resize the avatar throughout the forum though, not just in topic view. You could make it larger only in topic view with a bit of a CSS change if that interests you? If so, do you have a child theme set up?
Ike said
The avatar size is handled by a max-width rule in the forum admin menu, so you can change that in Forum > Profiles > Avatars > Maximum Avatar Display Width (Pixels)..This will resize the avatar throughout the forum though, not just in topic view. You could make it larger only in topic view with a bit of a CSS change if that interests you? If so, do you have a child theme set up?
Yes, I have a child theme already in place for sp topic view in reboot. I want to change the size of the avatars only in topic view.
It won't scale it because the rule set in the admin panel happens inline and will overwrite the CSS.
To get around this, you'll first have to add a new max-width rule then the actual size. Try something like:
#spMainContainer .spTopicPostSection .spPostUserAvatar img { max-width: 80px !important; width: 80px; }
The !important will overwrite the inline max-width, then your width underneath can be anything up to and including whatever your new max-width setting is.
You should really try and do this via the template displkay function - sp_UserAvatar() (see: https://simple-press.com/docum.....seravatar/) which has a 'size' argument that should be changed.
YELLOW
SWORDFISH
|
Ike said
It won't scale it because the rule set in the admin panel happens inline and will overwrite the CSS.To get around this, you'll first have to add a new max-width rule then the actual size. Try something like:
<br />
#spMainContainer .spTopicPostSection .spPostUserAvatar img { max-width: 80px !important; width: 80px; }<br />
The !important will overwrite the inline max-width, then your width underneath can be anything up to and including whatever your new max-width setting is.
I changed it in reboot.php to this:
#spMainContainer .spTopicPostSection .spPostUserAvatar img { max-width: 50px !important; width: 100px; }
But it did not change the setting.
did you follow Andy's suggestion for the template function?
Visit Cruise Talk Central and Mr Papa's World
Mr Papa said
did you follow Andy's suggestion for the template function?
Yea, I read it but didn't quite get it, so I didn't want to start messing with stuff that will break the forum. One thing though, which is the main reason why I didn't do anything else, is that I have the user's avatars show up in the forum view instead of the stock ones provided, so I did not want those to change in size. I only want the avatar to change in size when viewing the topic.
Sorry Alex,
I wasn't aware you could change the size using the template function, Andy is right that's really the correct way to do it. So - Open your spTopicViewDesktop.php from your child theme and locate the function on line 134 -
sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user', $spThisPostUser);
Add the argument 'size=80px' so it will then appear -
sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user&size=80px', $spThisPostUser);
It's worth noting that this only allows you to use 80 x 80px avatars in topic view, it doesn't force it as the argument imposes a max-width rule not a width rule. This means that a user who has a 50 x 50px avatar will not see a change, but a user using an 80 x 80px avatar before will now see it full size as it will no longer be restricted to 50 x 50px.
So if you wanted to force 80 x 80px avatars in topic view, you would still need to add the CSS rule I posted before changing the width of .spPostUserAvatar img to 80px, you just don't need to add the max-width CSS rule to the stylesheet.
And yes this will only affect topic view, everything posted in this topic so far has been topic view specific so you will retain the size constraints elsewhere.