How to add a user bio to the groups index page?

(Bart) #1

Hi,

I’m in the process of customising the information on our groups index page with a theme component. I’d like to add the user bio of each member. I found the template to override and am able to make changes this way. However, it eludes me how to access the biography data from the user_profiles table.

What I have so far:

      <tbody>
        {{#each model.members as |m|}}
          <tr>
            <td class='avatar'>
              {{user-info user=m skipName=skipName}}
            </td>

            <td>
              <span class="text">{{m.bio_excerpt}}</span>
            </td>

I also tried {m.user_profile.bio_excerpt} but in both cases I don’t get any data. Is this information available in a theme component, and if so, how should I access it?

Thanks!

(Régis Hanol) #2

It’s not. If you go to /groups/<name>/members.json, you’ll see that you only have access to these properties

  • id
  • username
  • name
  • avatar_template
  • primary_group_name
  • primary_group_flair_url
  • title
  • last_posted_at
  • last_seen_at
  • added_at
2 Likes
(Bart) #3

Ah darn. Is there any way I can query this data, or would this require a plugin?

(Régis Hanol) #4

You will have to use a plugin to add the bio_excerpt property to the GroupUserSerializer.

2 Likes