# 显示浏览量而非回复

**URL:** https://meta.discourse.org/t/show-views-instead-of-replies/187146
**Category:** Development
**Created:** [2021 年4 月 16 日 21:16 UTC](https://meta.discourse.org/t/show-views-instead-of-replies/187146 "2021-04-16T21:16:18Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [2023 年6 月 22 日 08:29 UTC](https://meta.discourse.org/t/show-views-instead-of-replies/187146/4 "2023-06-22T08:29:23Z")

</div>

我添加了一个插件出口，使其更加容易：

> <https://github.com/discourse/discourse/pull/22238>
>
> Introduces a new above-latest-topic-list-item-post-count outlet, providing a cle…an way to add other useful elements to the topic-stats section of the latest-topic-list-item template.
> 
> One example use case is replacing the post count with a view count as requested in \[this Meta topic\](https://meta.discourse.org/t/show-views-instead-of-replies/187146):
> 
> \<img width="568" alt="Screenshot 2023-06-21 at 5 21 31 PM" src="https://github.com/discourse/discourse/assets/22733864/912b77ed-887e-4402-a50d-0079ef61666d"\>

如果您将类似这样的内容添加到主题组件的 Head 部分，您会看到它添加了视图。您可以根据需要添加其他 HTML，然后进行样式设置 🙂

```xml
<script type="text/x-handlebars" data-template-name="/connectors/above-latest-topic-list-item-post-count/views-count">
  {{topic.views}} views
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/show-views-instead-of-replies/187146)._
