Edit what's being shown in the Leaderboard


#1

Is there a way we can edit or customize the content being shown in the leaderboard?

-> /users

I want to add in a new column that is not listed in the available choices? :slight_smile: Thanks.


(Felix Freiberger) #2

There’s no built-in way to customize this, so you’d need to build a custom plugin for that.

What do you want to add? Maybe you can convince the team that the new column makes sense as a core feature :slight_smile:


#3

Thank @fefrei
I want to add column like number of contributions made by our member that is not related to the forum eg. Talking in our event, Volunteering for our event, Submitting a blog post etc etc.

Also, I want to hide - number of views and read. :slight_smile:


(Felix Freiberger) #4

Okay, that’s definitely plugin territory, especially since this data also needs to get into Discourse somehow in the first place!

I would have guessed that hiding is easy with a bit of CSS like this:

.directory table td:nth-child(6), .directory table th:nth-child(6) {
    visibility: collapse;
}

…but that leaves a blank column behind, and I don’t really get why :thinking:


#5

@fefrei thanks this one.

You need to add - position: fixed; to remove the blank part. :slight_smile:

.directory table td:nth-child(6), .directory table th:nth-child(6) {
    visibility: collapse;
    position: fixed; 
}

(Felix Freiberger) #6

Whoa, nice! I consider myself to be somewhat fluent in CSS, but I guess there will always be a bit of mystery to it for me ¯\_(ツ)_/¯ :smiley:


(Joffrey Jaffeux) #7

AFAIK it’s because visibility keeps the element in the flow, you don’t see it visually but it takes “its space”.


(Stephen Chung) #8

Not with collapse which should shrink it down so it doesn’t take up space. hidden makes it merely invisible. Not sure why it still takes up space, but maybe the table is set to equal columns.

EDIT: Seems like visibility: collapse works weird on table cells. All the way back from IE quirks mode times.

For example:

How about good old display: none?

position: fixed takes it out of the flow, and combined with collapse makes it untraceable.