# Include text at bottom of post for users in group

**URL:** https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378
**Category:** Development
**Created:** [10월 24, 2018, 6: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:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 24, 2018, 6:25오후 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378/1 "2018-10-24T18:25:45Z")

</div>

I’ve a client that wants to add a link to a user profile for members of a particular group.

I thought about the signature plugin, but I’m wondering whether it might be possible with a theme component.

Is there some way that in the `:after` of a post members of a certain group could have `I'm great, see my [profile](https://site/u/username)` in a theme component?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [10월 24, 2018, 9:30오후 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378/2 "2018-10-24T21:30:14Z")

</div>

It could be done in a theme component with `api.decorateWidget` if the information you need about the user is available in the `helper.attrs` property that is passed to the function. This will work if the group you are looking for is the user’s primary\_group.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 25, 2018, 1:23오전 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378/3 "2018-10-25T01:23:01Z")

</div>

Ooh. That sounds like what I’d hoped for. The group will be the primary group.

Can you give me another hint or two about just how `api-decorateWidget` works?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [10월 25, 2018, 2: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>

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 25, 2018, 11:38오후 UTC](https://meta.discourse.org/t/include-text-at-bottom-of-post-for-users-in-group/100378/5 "2018-10-25T23:38:00Z")

</div>

Thanks a million, @simon. I really appreciate it. I’m still very novice at themes.

Here it is: [GitHub - literatecomputing/discourse-theme-group-signature: Append text to posts of members of a particular group · GitHub](https://github.com/literatecomputing/discourse-theme-group-signature)

I put the text of the link and the groups in theme settings. There is an alternate/second signature that has a customizable URL.

Is there a way to get a theme setting to use a selector, for example, the group selector?
