如何在群组索引页面添加用户简介?

你好,

我正在使用主题组件自定义我们群组索引页面上的信息。我想添加每位成员的个人简介。我已经找到了需要覆盖的模板,并能够通过这种方式进行修改。但是,我还不清楚如何从 user_profiles 表中访问传记数据。

我目前的内容如下:

      <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>

我也尝试过 {m.user_profile.bio_excerpt},但在两种情况下都没有获取到任何数据。这些信息在主题组件中是否可用?如果可用,应该如何访问?

谢谢!

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.