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

סיכום מבוסס בינה מלאכותית

In a discussion about adding user bios to the groups index page, bartv attempted to access bio data via a theme component but found it unavailable in the JSON response from /groups/<name>/members.json, which only includes basic user properties like id, username, and avatar. zogstrip confirmed that user bio information is not exposed to theme components. bartv asked if there was a way to query the data or if a plugin was required. zogstrip clarified that a plugin would be necessary to extend the GroupUserSerializer to include the bio_excerpt field, pointing to the relevant GitHub file for reference. The takeaway is that theme components cannot access user profile bios directly — this requires server-side modification via a plugin.

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!

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

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

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