Howto: Change lock icon for restricted categories

(Tobias Eigen) #1

Continuing the discussion from Alternatives to lock icon for categories:

@cpradio could you or someone else provide a simple howto for changing the lock icon for categories? It’s now coming up in my community as something they find confusing because it is the same as the topic lock icon. I had some trouble finding the actual howto instructions in this thread.

Would be grateful!

Is there a way to remove the lock badge for some categories but not for others?
(cpradio) #2

Sure. First off, what do you want it changed to? (as the above will remove the lock icon)

To switch it, you simply go to the font-awesome website ( Font Awesome Icons )

Click on the icon you want (that exists within the version of Font Awesome Discourse is using). Copy its unicode value ( see fa-eye-slash: Font Awesome Icons )

Paste the unicode value in the “” next to context and put a slash in front

.badge-category i.fa.fa-lock:before { content: "\f070"; }
.category i.fa.fa-lock:before { content: '\f070'; }

(Tobias Eigen) #3

AWESOME! Thanks so much for clarifying this. Will be great for other customizations as well.

Now to find a good icon… hesitate to ask and return to the bikeshedding going on in the other thread, but… what are other sites using?

(cpradio) #4

We use eye-slash, it makes it clear to us at least that it isn’t a publicly visible area.

(Tobias Eigen) #5

I changed it to eyeslash on my site using @cpradio howto, but weirdly it did not change for top level categories on the categories page. Did change it everywhere else though. Any ideas?

(cpradio) #6
.badge-category i.fa.fa-lock:before { content: "\f070"; }
.category i.fa.fa-lock:before { content: '\f070'; }

Edit: You may not need the first CSS rule with this one. It might take affect on all of the instances.

(Tobias Eigen) #7

that worked! you’re a star. :star2:

(cpradio) #8

Just so you know, it seems both rules are necessary, as the first rule covers the category drop downs on the Latest page and New Topic dialog, and the second rule covers all page write outs of the category badges.So you can’t just use one, you have to use them both.

(Daniela) #9

Changing an icon globally is very simple using APIs

(Daniela) closed #10