Hello - I am using Reboot and have created a child theme per the instructions.
Most of my users get assigned to 1 user group, however a small number of users might be members of several user groups. Almost all user groups have a custom rank badge assigned to them.
Using my child theme, I successfully made several changes to the user's profile display of user groups on their posts:
- Don't display the text name of any group(s) the user is a member of
- Display the custom rank badge(s) of any group(s) the user is a member of (if the user group doesn't have a badge, nothing is displayed)
However, I need to make these same changes to the user profile popup and full profile.
In my screenshot below, the user belongs to 3 user groups, "curator", "CMS Faculty" and "Moderator". Moderator has no custom rank badge. You can see on their post profile they show Curator and CMS Faculty badges. But on the popup, it show the badges, the user group name as text, and the text for the level of "Moderator" and the user group "Moderators" which has no custom badge.
I want to see ONLY custom rank badges on the user profile popup and full profile displays.
I copied spProfileShow.php and spProfilePopupShow.php into the appropriate child theme folder, and located sp_SectionStart('tagClass=spProfileShowAvatarSection spLeft', 'profileAvatarRank'); where the magic seems to happen.
I can block the text "Moderator" by commenting out the line:
However I lose both the text and forum rank badges (nothing is displayed) if I comment out:
Can you tell me where the code is located that let's me block display of the profile's user group text names but will still allow the user group rank badges, if present, to be displayed?
so you just want the badge and no title??? these are the three template functions at play:
sp_UserForumRank('', $spProfileUser->rank); sp_UserSpecialRank('', $spProfileUser->special_rank); sp_UserMembership('', $spProfileUser->memberships);
for all three, they have these couple of arguments:
'showTitle' => 1, 'showBadge' => 1,
which default to showing titles and badges... you can customize to not show titles by chaning showTitle to 0... so,for example:
and similarly for others (since all arguments are part of the first string passed to the template function...
Ok - it worked!
I only modified sp_UserMembership by adding the showTitle=0 parameter. This gets rid of all of the user group text names but leaves the badges.
FYI, When I use showTitle=0 with sp_UserForumRank, it does suppress the special "Moderator" text, but it then messes up the display of the UserMembership badges:
- In the ProfilePopup view, it removes the small space between the avatar photo and each badge, stacking them on top of each other and touching
- In the full Profile view, it removes the small space between the avatar photo, and the badges display side-by-side and touching just below the photo, also touching the photo.
No big deal with that; I am going to leave sp_UserForumRank with the defaults; only a couple members are a moderator and it is fine for just this text to show up on the profile when clicked on.
Thanks again for the quick help!