Howto: Change lock icon for restricted categories

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!

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 ( http://fortawesome.github.io/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 http://fortawesome.github.io/Font-Awesome/icon/eye-slash/ )

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'; }
4 Likes

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?

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

1 Like

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?

.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.

3 Likes

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

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.

1 Like

Changing an icon globally is very simple using APIs

3 Likes

Just a small update on this one - the Category Icons theme component now has a built-in setting to make swopping out the category lock icon even easier. :tada:

1 Like