# 在帖子正文中移动主题帖头像

**URL:** <https://meta.discourse.org/t/move-topic-post-avatar-within-post-body/133059>\
**Category:** Development\
**Created:** [2019年十一月10日 20:04 UTC](https://meta.discourse.org/t/move-topic-post-avatar-within-post-body/133059 "2019-11-10T20:04:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottrepreneur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scottrepreneur/32/155324_2.png) [@scottrepreneur](https://meta.discourse.org/u/scottrepreneur)\
**Post date:** [2019年十一月10日 20:04 UTC](https://meta.discourse.org/t/move-topic-post-avatar-within-post-body/133059/1 "2019-11-10T20:04:58Z")

</div>

我想就如何为我的实例实现所请求的布局调整获取更多指导。我希望将头像移动到帖子正文内部。

 ![avatar in post body](https://global.discourse-cdn.com/meta/original/3X/2/3/23d7b74ec5c775c353feb4e5977f8f802ae5ea92.jpeg)

我认为需要重新打开 [`post-article`](https://github.com/discourse/discourse/blob/61b1f9c36be9b87e8ef5040cca41f93ac35396c2/app/assets/javascripts/discourse/widgets/post.js.es6#L504) 和 [`post-body`](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/post.js.es6#L484) 这两个小部件，以调整头像的附加时机。

从 `post-article` 中可以看到，头像是在正文之前添加的：

> <https://github.com/discourse/discourse/blob/61b1f9c36be9b87e8ef5040cca41f93ac35396c2/app/assets/javascripts/discourse/widgets/post.js.es6#L568-L575>

是否可以将头像改为添加到 `post-body` 中？  
[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/post.js.es6#L487-L493](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/post.js.es6#L487-L493)

因此，解决方案是否是从 `post-article` 中移除 `this.attach("post-avatar", attrs)`，并将其作为 `post-body` 的一部分添加？

```
...
let result = [this.attach("post-avatar", attrs)];
result.push(this.attach("post-meta-data", attrs));
...

```
