# 如何在主题中显示浏览量和其他信息？

**URL:** <https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430>\
**Category:** Support\
**Tags:** topic-map\
**Created:** [2023年八月24日 11:56 UTC](https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430 "2023-08-24T11:56:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/glow/32/292911_2.png) [@Glow](https://meta.discourse.org/u/Glow)\
**Post date:** [2023年八月24日 11:56 UTC](https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430/1 "2023-08-24T11:56:09Z")

</div>

您好，我想了解一下当用户发布主题时，如何获取类似下图的信息？

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/3/5/f353feb8410e45dc31b6fa7c7babcf74676e75d3.png)

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年八月24日 12:04 UTC](https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430/2 "2023-08-24T12:04:09Z")

</div>

这就是主题地图。如果至少有一条回复，它应该会自动显示。

目前有一个开放的 #Contribute > UX 主题，建议在没有回复的主题中也添加它。其中还提到一个可能对你也很有用的开发技巧：

> [@如何在非评论帖中显示主题图](https://meta.discourse.org/t/how-to-show-topic-map-on-non-commented-posts/204222/15?u=jammydodger):
>
> 你好， 现在我看到了这个话题，我想起了我之前看到过[关于这个的提交](https://github.com/discourse/discourse/pull/19302)。:slightly\_smiling\_face: 我认为现在应该可以了 arrow_down_small Header \<script type="text/discourse-plugin" version="0.8"\> api.includePostAttributes('topicMap'); \</script\> 我还添加了一些 CSS 来隐藏没有其他帖子时不需要的统计信息。 Common / CSS body:not(.archetype-private\_message) { .topic-post.regular { // if last-of-type is the #post\_1 &:last-of-type { article#post\_1 { .topic-map { width: max-content; nav.but…

---

<div class="post-metadata">

**Author:** ![Glow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/glow/32/292911_2.png) [@Glow](https://meta.discourse.org/u/Glow)\
**Post date:** [2023年八月24日 12:05 UTC](https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430/3 "2023-08-24T12:05:17Z")

</div>

谢谢！❤

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年九月23日 12:05 UTC](https://meta.discourse.org/t/how-to-show-views-and-other-information-in-a-topic/276430/4 "2023-09-23T12:05:33Z")

</div>

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