Category Icons

@ScammerRevolts @zooy0rk Hahah, I had the same issue. So glad the issue wasn’t more serious, never would have guessed this was the cause as I had some other postgres related errors during the rebuild. :sweat_smile: Was already prepping a new instance to restore a backup to. Totally fine now once this component was updated, it was ~4 revisions behind I believe.

Safe mode was really helpful for narrowing down the issue: How to use Discourse Safe Mode

2 Likes

This is now merged @md-misko, thanks for the PR!

I also added a small fix to core to show include these icons in the Boxes with Subcategories layout for /categories.

2 Likes

I see subcategory icons when Subcategory List Style is set to Boxes with featured topics, but not when it is set to Boxes only?

1 Like

Right, the fix for that is in core, so you need to rebuild your site.

3 Likes

Hi all - I have installed the plugin but I can’t seem to find where I can configure it?

Is this compatible with 2.6.0.beta2?

here is my app.yml

hooks:
  after_code:
    - exec:
	cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
  ##        - git clone https://github.com/discourse/discourse-adplugin.git
  ##        - git clone https://github.com/discourse/discourse-solved.git
  ##        - git clone https://github.com/discourse/discourse-akismet.git
  ##        - git clone https://github.com/discourse/discourse-bbcode.git
  ##        - git clone https://github.com/discourse/Discourse-Tiles-image-gallery.git
  ##        - git clone https://github.com/tshenry/discourse-versatile-banner.git
          - git clone https://github.com/discourse/discourse-category-icons.git

## Any custom commands to run after building

I have rebuild but can see anything anywhere on the admin panel to config?

Please help

1 Like

Hello this is not a plugin! This is a theme component.

Please read how to install a theme component: How do I install a Theme or Theme Component?

Edit: These are also theme components so install this way :arrow_up:

- git clone https://github.com/discourse/Discourse-Tiles-image-gallery.git
- git clone https://github.com/tshenry/discourse-versatile-banner.git
6 Likes

Thank you Don you’re a star - as you can tell brand-new to this platform

Ant

2 Likes

Hi, I’ve just created a PR to add a new option to specify the colour for the icon as “catcol” which will cause it to pickup the colour of the category (as seen in the category stripe and set under edit category|general|background colour
eg “test,hands-helping,catcol,partial”

Most useful with the partial name match so that, in the example, the same icon can be used for all categories with “test” in their slug but they will each pick up their own category colour rather than all using the same. Also provides a quick alternative to having to select a colour for a one-off icon (exact match) - simply use the category colour.

This will also be useful with a proposed further new option to have the icon replace the category stripe whilst maintaining the category colour hint - to be subject of a future PR

RogerCO

3 Likes

@rogerco’s PR is now merged, you can use the category colour now by adding the special keyword “categoryColour” where the icon color should go. Thanks Roger!

2 Likes

Color is not applied on icons in /categories wiew?

2 Likes

Ah, sorry about that, should be fixed now.

2 Likes

Hi, does this component require FontAwesome or can I use my own icons?

1 Like

I don’t know if it may be useful for anyone else, but I’ve submitted a pull request for discourse-category-banners to show the discourse-category-icons icon beside the banner title. I’m using it in production here.

9 Likes

Thanks @renato, your PR is now merged.

6 Likes

This is a nice addition, but it doesn’t work as expected if the category icon color is set to the same color as the category (you use default black for your category icons in your example, and they get inverted to white, same as the title).

The icon color in the title should probably be set explicitly to the same color as the title, so that any color icons could be used?

3 Likes

I had this same issue on my instance, but I realized that by omitting the color of the category icon it takes the appropriate color, being white when on the category renderer: imageand on the banner title, but black when the background is white: image.

However, if you don’t use the box category style and the category icon color is set to the same color as the category background, you’re right, the icon becomes “invisible”.

We could explicitly set it to something else, sure. The banner title uses the category color, maybe this is the safest bet, as you suggested. @pmusaraj what do you think?

4 Likes

Yes, that works for me.

2 Likes

Hi. This is a great component. Is it possible to turn off the category icons when they appear in category lists? In our case we want to use the category icons everywhere else they appear but not in the category list drop-down.

1 Like

Yes you can add some CSS to hide the icons in the specific lists.

2 Likes

Hi Penar. Note that we want to keep the icons for all categories but we want to disable the display of the icon only in the category list control drop-down. I’ve tried working with the “fa d-icon d-icon-lock svg-icon svg-string” and 'category-name" classes but had no luck. Where should I apply the CSS settings? Can you give me a suggestion of settings to try?

Thanks,
Doug

3 Likes