添加类别列

:discourse2: Summary Add Category Column adds a category column to the topic lists.
:eyeglasses: Preview Preview on Discourse Theme Creator
: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

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 who may be struggling with the changes.

:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @JammyDodger 2024-06-11T08:06:49Z

Check documentPerform check on document:
51 个赞

你好,

更新到 2.9.0.beta2 后出现了一些警告/错误。
也许在 2.9.0 之前就已经存在了,因为我之前从未注意过。

[Warning] [THEME 17 'Add Category Column'] – "为防止测试出错,请在 `modifyClass` 调用中添加 `pluginId` 键。这将确保修改只应用一次。" (application-02f34826699ddd1471a048c99dbf7e34.js, line 4135)

[Warning] [THEME 17 'Add Category Column'] – "弃用通知:topic 模型中的 displayNewPosts 属性已被弃用" (vendor-3037b934520b46fd8178e08db12bbeaa.js, line 4759, x30)
2 个赞

我已发送一个 PR (https://github.com/discourse/discourse-add-category-column/pull/2) 来修复此问题并添加一些更新。

2 个赞

谢谢!希望在此期间能得到审核 :slight_smile:

2 个赞

感谢 @Dmitry_Krasnoperov 的提醒和 @Don 的 PR!PR 已合并。在查看组件时,我还修复了几个小问题。

3 个赞

此主题组件已损坏,因为它覆盖了 topic-list-header 和 topic-list-item 模板,并且已有一段时间未更新。它仍然显示额外的列,但无法批量选择主题。

我已对其进行重构,使其使用原始插件出口,从而更具未来适应性且更易于维护。

我已在此处提交了一个拉取请求:https://github.com/discourse/discourse-add-category-column/pull/6。

7 个赞

嗯,看来移动端存在一个问题:

Laurent 停用该组件后,问题就消失了。这是一个已知问题吗?

3 个赞

看起来应该在移动视图中添加此列。

https://github.com/discourse/discourse-add-category-column/blob/main/javascripts/discourse/raw-views/add-category-column-list-item.js

这里可能缺少 && this.site.mobileView :thinking:

这似乎是此更新的一个回归,该更新消除了覆盖模板。

3 个赞

感谢您的报告 @tessus!正如 @Arkshine 所提到的,在上次修复后,这个问题被忽略了。

在经过审核和合并后,这将解决它:

4 个赞

好的,谢谢。

1 个赞

只是快速说明一下,修复已合并 :rocket: 您可以继续更新组件。感谢您的报告 @tessus

1 个赞

谢谢修复!

1 个赞

Display a category as a calendar by scheduled Topic-timer dates - #4 by manuel 中,我一直在寻找一种方法来在主题列表中查看主题计时器。试图查看/跟踪内容发布计划。

@manuel 提到,如果这个组件有一个可以排序的列(按 topic-timers),也能达到我想要的效果:按发布时间对一系列主题进行排序。

1 个赞

非常感谢您的 Theme 组件,但我遇到了一些显示错误。当我返回主页时,类别列不再显示。此外,当我加载更多页面时,类别也不再显示。请观看我的视频:

1 个赞

可以为“添加组标签列”进行开发吗?4 到 9 个组标签列?

谢谢!

看起来该插件与 AI 相关搜索不兼容。它会弄乱“建议/相关 (AI) 主题”的表头。

1 个赞

您好,非常感谢您提供的这个出色的主题组件!

我正在使用“Add Category Column”在主题列表中显示分类名称。但是,我遇到了两个希望解决的问题:

分类名称过长会被截断——它们不会换行或扩展,因此用户无法阅读完整的分类名称。是否有办法让列自动扩展、换行文本或在悬停时显示完整名称?

如何重新排序列?
我想更改布局,使其首先显示“Category”列,然后是“Topic”标题,“User”、“Views”、“Date”等。

任何建议或 CSS 覆盖都将非常感激。谢谢,Discourse 团队!

1 个赞