[Category List Widget] Custom lock icon and Pavilion sidebar style

I’ve recently changed the icon for locks on my forum to unlock-alt using https://github.com/discourse/discourse-category-icons.git

Naturally, they don’t apply to this widget. How would I go about changing the icon that is used?

Also, are you going to be sharing the nice Category List Widget that you are using here in thepavilion.io? It is very nice!

Hey @Nathan,

I’m not sure how that theme component is doing it, but if you add this to your head tag:

<script type="text/discourse-plugin" version="0.8">
  api.replaceIcon('lock', 'unlock-alt');
</script> 

It replaces the icon site wide, allowing it to be changed for the category list widget as well.

Yes, actually, its already available for you to enjoy. To achieve this look:

In your Layouts Settings:
Set layouts sidebar left position to full.

In your Category List Widget Settings:

  1. Check collapsible sidebar setting to true
  2. Check auto generate category logos to true
  3. Set collapsible sidebar desktop toggle to top

Thank you - however, I only want it changed for categories and not topics. That will be a degree harder, eh?

Yeah that would be a little bit harder. You could probably use the api method:

api.reopenWidget("layouts-category-link", {});

and copy all the original content, but you’d only be replacing one line:
contents.push(iconNode("lock"));
contents.push(iconNode("unlock-alt"));

however, this won’t be great for maintainability of the component.

Well, I’ve had a crack at the Widget TC and it is now working for me with some lovely unlock icons:

image

Please see my PR:

https://github.com/paviliondev/layouts-category-list-widget/pull/9

:star_struck:
And btw, is it intentional that setting layouts sidebar left position to full also hide the right sidebar ?

@Benjamin_D yeah, the full sidebar style is intended to be used as a full width/height left sidebar only. Currently, the right sidebar is not supported when the left sidebar is in the full format.