Install this theme component
Features
Unanswered Filter adds a new breadcrumb dropdown that allows users to filter a topic list by unanswered (0 replies) and answered topics (more than 1 reply). There’s also an option to show an “unanswered” link in the nav as an alternative to the dropdown.
dropdown mode:
link mode:
Settings
Name
Description
exclusions
limit to groups
only show the filter for members of these groups
filter mode
Exclusions : you can exclude this filter from a page on your site, defaults to / and /top
Limit to groups : you can choose to only show the filter to specific groups (staff, for example)
Filter mode : defaults to dropdown, with the link style as an alternative
Translation
Default
topic_answered_filter.all
any status
topic_answered_filter.unanswered
unanswered
topic_answered_filter.answered
answered
unanswered.title
Unanswered
unanswered.help
Topics that have not been answered
Credits
It was adapted from this post by @simon
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Last edited by @JammyDodger 2024-06-16T11:24:36Z
Check document Perform check on document:
46 个赞
Canapin
(Coin-coin le Canapin)
拆分了此话题
2023 年10 月 17 日 14:31
21
4 篇帖子已拆分为新主题:为列表元素添加 ID 或类
Canapin
(Coin-coin le Canapin)
拆分了此话题
2023 年10 月 17 日 14:39
25
ToddZ
2023 年9 月 23 日 08:29
30
您好 @awesomerobot – 我刚试用了 [之前的行为] “未回答过滤器链接”组件,它几乎完全符合我的需求。我还有一些希望改进的地方:
我希望能够跳过具有指定类别和标签的主题。一些信息性主题实际上不需要回复;它们可能属于特定类别,或被标记为“文档”等。例如,置顶的“欢迎”帖子可以通过标签排除。
我希望“未回答”的行为更像“新”和“未读”:仅在非零时出现,并显示计数。当看起来没有相关的未读主题时,点击的吸引力会降低。
如果能加上这些改进,它就完美了——而且,我认为,应该将其添加为 Discourse 的核心功能。
2 个赞
ToddZ
2023 年10 月 10 日 09:23
31
供其他人参考,谨此说明:
我决定尝试使用较新的“未答问题筛选器”组件。我不知道这是否是我特定 Discourse 实例中的一个故障,但我在使其正常工作时遇到了一些麻烦。我卸载、重新安装并重启,试图让它显示出来,最后:
cd /var/discourse
./launcher destroy app
./launcher start app
……才让它生效。
在清除组件设置中的所有排除项后,我花了一点时间才意识到为什么状态筛选器不会出现在“分类”视图中(在我们这里,我们默认首页为“分类”):因为它是一个主题筛选器 。[拍额头] 它显然无法筛选分类列表。
我仍然希望它能按标签排除主题,这样它就不会将信息性主题列为“未答问题”,但一个简单的解决方法是在锁定主题之前,先回复一条,例如*“此主题已锁定。”*。
效果如宣传——很棒的组件。
1 个赞
我刚刚合并了一个重构,修复了下拉菜单未更新的问题,并更新了使用的 Ember 版本
main ← refactor-fix
opened 05:08PM - 16 Oct 23 UTC

A customer has reported that the status no longer updates in the dropdown, despite the URL changing and the topics being filtered. I believe this was a case where the component was relying on the loading route to destroy it and the loading slider broke this. Updating to a tracked property using Glimmer fixes it.
如果出现任何新问题,请务必告知我们!
5 个赞
一个非常好的插件,谢谢!
能否对其进行调整,使其不显示员工帖子的列表?我们只关心那些没有得到回复的普通用户。希望员工们能自己处理。
理想情况下,再增加一个过滤器会很棒,该过滤器可以显示未被员工回复的帖子。以防万一,我们需要确保帖子至少被一名员工审查和回复过,而不是普通用户。
1 个赞
我刚刚将此组件的一个更新合并,该更新添加了几个设置:
Taylor:
限制到群组 :您可以选择仅向特定群组(例如,员工)显示过滤器
过滤模式 :默认为下拉菜单,链接样式为替代选项
limit_to_groups 替换了之前的 show_only_for_staff 设置(您可以使用 staff 群组代替)
1 个赞
@awesomerobot ,在最近的更新后,我遇到了这个错误:
Error: Could not find module `discourse-i18n` imported from `discourse/theme-10/initializers/unanswered-filter-link`
您有什么关于如何解决这个问题的建议吗?
您近期是否有可能更新此插件以显示 未由staff组创建的、回复数为零的帖子?
Gabrielius:
在最近一次更新后,我收到了这个错误:
您的 Discourse 安装是最新的吗(管理员/升级)?我预计更新会解决这个问题
目前没有计划,我认为没有直接的方法可以做到这一点……这个主题组件依赖于内置的 URL 参数来获取 0 回复(?max_posts=1),但我不认为我们有办法隐藏由特定组用户创建的帖子。
您是否按类别进行了筛选?在移动设备上,类别筛选器(包括此筛选器)在发现路由(最新/热门/热门等)中隐藏。
如果您愿意,可以通过向您的网站主题添加 CSS 来显示这些筛选器:
.category-breadcrumb.hidden {
display: flex !important;
}
1 个赞