Number of group members in legend
2 posters
Page 1 of 1
Number of group members in legend
Hello,
I was wondering if somebody already posted a way to automatically display the number of people in a group e.g. next to the groupname in the legend. I'm aware it's not a function of forumotion itself and I would have to do it manually currently.
Example would be:
[Adminstrators: 3] [Newbies: 5] [Warriors: 21] [Archers: 12], etc
or something along those lines?
Best,
Zwiebel
I was wondering if somebody already posted a way to automatically display the number of people in a group e.g. next to the groupname in the legend. I'm aware it's not a function of forumotion itself and I would have to do it manually currently.
Example would be:
[Adminstrators: 3] [Newbies: 5] [Warriors: 21] [Archers: 12], etc
or something along those lines?
Best,
Zwiebel
Last edited by Zwiebel on January 11th 2023, 1:40 pm; edited 2 times in total
Re: Number of group members in legend
Here you go. Go to CP - Modules - Javascript, make a new script and apply only for homepage. Add this code:
Save. Let me know the results. For me it works like this:

- Code:
$(document).ready(function() {
var numberOfGroups = $(".block-footer b a").length;
for (i = 0; i < numberOfGroups; i++) {
var titleValue = $(".block-footer b a")[i].getAttribute("title");
var numberOfUsers = titleValue.slice(titleValue.indexOf(":"));
var originalText = $(".block-footer b a")[i].innerHTML;
$(".block-footer b a")[i].innerHTML = originalText + numberOfUsers;
}
});
Save. Let me know the results. For me it works like this:

Guest- Guest
Re: Number of group members in legend
aaaaww men, this is so smart and simple! thank you. I saw that they basically give you the number in the title of the link but I wouldn't have known how to extract it.
works just fine <3
works just fine <3
Re: Number of group members in legend
Yeah, simple slice method does the trick.Zwiebel wrote:aaaaww men, this is so smart and simple! thank you. I saw that they basically give you the number in the title of the link but I wouldn't have known how to extract it.
works just fine <3
Guest- Guest
Re: Number of group members in legend
Problem solved & topic archived.
|

» number of group members in legend.
» Group Legend question: How do I have a group show up on the legend, but not colour my members?
» Adding all members to a Legend Group
» Improvement : View the number of members in group's
» How to make group become legend or show in legend?
» Group Legend question: How do I have a group show up on the legend, but not colour my members?
» Adding all members to a Legend Group
» Improvement : View the number of members in group's
» How to make group become legend or show in legend?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum