# 在主题显示页面加载时获取主题 ID

**URL:** <https://meta.discourse.org/t/get-topic-id-when-the-topic-show-page-loads/155620>\
**Category:** Development\
**Created:** [2020年六月22日 21:05 UTC](https://meta.discourse.org/t/get-topic-id-when-the-topic-show-page-loads/155620 "2020-06-22T21:05:32Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)\
**Post date:** [2020年六月24日 14:36 UTC](https://meta.discourse.org/t/get-topic-id-when-the-topic-show-page-loads/155620/22 "2020-06-24T14:36:33Z")

</div>

在插件中使用这些标签信息需要序列化器吗？

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2020年六月24日 14:38 UTC](https://meta.discourse.org/t/get-topic-id-when-the-topic-show-page-loads/155620/23 "2020-06-24T14:38:11Z")

</div>

这确实是主题视图序列化器的一部分（它是一个被包含的 Mixin）。因此，如果您想更改包含的数据，可能需要修改此部分（通过在您的插件中覆盖它）。

[上一頁](https://meta.discourse.org/t/get-topic-id-when-the-topic-show-page-loads/155620.md?page=1)
