如何过滤嵌入中的话题?

Hello @eviltrout, I noticed that the topic list includes unlisted, closed, archived topics. I guess these should not be taken into account in the list. Given:

 <d-topics-list discourse-url="https://discourse.example" per-page="5" category="11"></d-topics-list>

Or is there a filter to only keep open topics?

2 个赞

You should be able to use status="open" for that restriction.

12 个赞

是否有任何文档显示了链接的过滤器选项可用的参数?

例如,

这表明我也应该能够使用 status="noreplies"status="solved",因为它们是从 UI 中公开的选项。

但我认为它们被忽略了,因为它们是无效选项,因为结果与不带参数的结果相同(同样,当过滤到 status=unsolvedstatus=solved 时,它们应该是相反的)。

或者,如果有一种不同的方法可以传递自定义搜索词,我也没问题——我尝试了 https://discourse.getdbt.com/embed/topics?template=complete&top_period=all&search="status%3Anoreplies"(冒号已编码和未编码),但使用这种方法没有得到任何结果。

请注意,我直接嵌入 iframe 而不是使用 <d-topics-list> 占位符元素,因为我们遇到了这个问题:

但我不认为这是问题的原因,因为导入的 JS 只是在构建 iframe URL。

2 个赞

此功能的参数列表与搜索使用的不同。请查看控制器代码以检查现有参数。

2 个赞

OK,我查看了 embed_controller.rb,看起来当构建 topic 查询时,它只考虑了原始帖子中允许的参数(templateper-pagecategoryallow-createtagstop_period):

我认为这使得

成为一个误导。我将提交一个功能请求,允许在此嵌入中添加其他参数。感谢 @Falco 的帮助 :pray:

3 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.