# 在用户主导航下渲染模板

**URL:** https://meta.discourse.org/t/render-template-under-user-primary-navigation/155884
**Category:** Development
**Created:** [2020年六月25日 06:56 UTC](https://meta.discourse.org/t/render-template-under-user-primary-navigation/155884 "2020-06-25T06:56:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wyudong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wyudong/32/180747_2.png) [@wyudong](https://meta.discourse.org/u/wyudong)
#### Post date: [2020年六月25日 06:56 UTC](https://meta.discourse.org/t/render-template-under-user-primary-navigation/155884/1 "2020-06-25T06:56:31Z")

</div>

我的插件旨在用户主导航中添加一个新标签页，并在点击时显示一个页面。但页面未显示在正确的位置。请见：

 ![当前结果](https://global.discourse-cdn.com/meta/original/3X/5/5/5512b600ad329e96ca9b9e742a5c63b7daa4ce5e.png)

像其他标签页（例如“徽章”）一样，我希望模板在导航下方渲染，且路由应包含 `/u/:username/`。如何以正确的方式实现？

 ![期望结果](https://global.discourse-cdn.com/meta/original/3X/c/2/c294aaca013806e1cb8168b1aaaeb054a922ad6e.png)

[插件代码](https://github.com/wyudong/discourse-license) 可在 GitHub 上找到。非常欢迎任何建议。

---

<div class="post-metadata">

### Author: ![wyudong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wyudong/32/180747_2.png) [@wyudong](https://meta.discourse.org/u/wyudong)
#### Post date: [2020年六月27日 02:36 UTC](https://meta.discourse.org/t/render-template-under-user-primary-navigation/155884/2 "2020-06-27T02:36:33Z")

</div>

终于成功了。关键在于按如下方式修改 **license-route-map.js.es6** ：

```plaintext
export default {
  resource: 'user',
  map () {
    this.route('license', { resetNamespace: true })
  }
}

```
