# 为群组用户添加帖子底部文本

**URL:** <https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378>\
**Category:** Development\
**Created:** [2018 年10 月 24 日 18:25 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378 "2018-10-24T18:25:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
发布日期： [2018 年10 月 25 日 02:33 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378/4 "2018-10-25T02:33:30Z")

</div>

It can take a bit of messing around to find the right widget and type. The easiest way to do that is to look through the source code. Searching for `applyDecorators` in the widget files lets you know what types are available. The following works, but you should test it. Do a `console.log` on the `attrs` variable to see what is available to you. It will take a bit of CSS to get it to look good.

```plaintext
<script type="text/discourse-plugin" version="0.8.25">
   api.decorateWidget('post-contents:after-cooked', helper => {
       let h = helper.h,
           attrs = helper.attrs;
        if (attrs.primary_group_name === 'your_primary_group_name') {
            return h('div.group-signature', h('a.group-user-link',
                { href: '/u/' + helper.attrs.username }, 'See my profile!'));
        }
    });
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378)._
