Add Category Column

:discourse2: Summary Add Category Column adds a category column to the topic lists.
:eyeglasses: Preview Preview on theme-creator.discourse.org
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-add-category-column
:open_book: New to Discourse Themes? Beginnerā€™s guide to using Discourse Themes

Install this theme component

Until recently Some time ago, categories were displayed in the topic lists as a column. After discussing its usefulness, the dedicated column for categories seemed excessive and it was removed in favor of placing the category under the topic title. There is plenty to gain from this change (see the above linked topic for details), however, some have voiced that they prefer having the category column. This component is for those that may be struggling with the changes.

51 Likes

Hello,
There are some warnings/errors after update to 2.9.0.beta2.
Maybe it was before 2.9.0 as I never pay attention earlier.

[Warning] [THEME 17 'Add Category Column'] ā€“ "To prevent errors in tests, add a `pluginId` key to your `modifyClass` call. This will ensure the modification is only applied once." (application-02f34826699ddd1471a048c99dbf7e34.js, line 4135)

[Warning] [THEME 17 'Add Category Column'] ā€“ "Deprecation notice: The displayNewPosts property of the topic model is deprecated" (vendor-3037b934520b46fd8178e08db12bbeaa.js, line 4759, x30)
2 Likes

I sent a PR to fix this and add some updates.

2 Likes

Thanks! Hope it will be reviewed in mean time :slight_smile:

2 Likes

Thanks for the heads up @Dmitry_Krasnoperov and for the PR @Don! The PR has been merged. I fixed up a couple minor things with the component as well while I was looking at it.

3 Likes

This theme component was broken because it overwrote the topic-list-header and topic-list-item templates and it hadnā€™t been updated in a while. I did still show the extra column but bulk selection of topics didnā€™t work.

Iā€™ve reworked it so it uses raw plugin outlets so itā€™s more future proof and easier to maintain.

Iā€™ve made a PR here.

7 Likes

Hmm, it seems that there is an issue on mobile:

After Laurent deactivated the component the problem was gone. Is this a known problem?

3 Likes

It looks like this column should be added on mobile view.

It misses likely a && this.site.mobileView here :thinking:

It seems to be a regression from this update that eliminates overwriting templates.

3 Likes

Thanks for the report @tessus! As @Arkshine mentioned, this slipped under the radar after the last fix.

This should take care of it after itā€™s been reviewed and merged:

4 Likes

Perfect, thanks.

1 Like

Just a quick note to mention that the fix has been merged :rocket: You can go ahead and update the component. Thanks for the report @tessus!

1 Like

Thanks for the fix!

1 Like