שדה משתמש לא עובד ב-plugin outlet

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

MihirR is trying to display a user field (user-fields/5) in the above-user-summary-stats plugin outlet using a Handlebars template, but it’s not loading. awesomerobot responds that more context is needed, particularly how this.fieldValue is defined. They suggest two approaches: (1) if the field is meant to be public, add user_field_5 to the site setting Public user custom fields, then access it via {{@user.custom_fields.user_field_5}} in the template or this.args.user?.custom_fields?.user_field_5 in JS; or (2) if it’s not public, access it directly via this.args.user?.user_fields?.[5] without modifying site settings. The issue likely stems from how the field value is being referenced or whether the field is properly configured as public.

אני מנסה להוסיף שדה משתמש זה: user-fields/5 בשקע זה: above-user-summary-stats. אבל זה לא נטען, הנה ה-hbs שאני מנסה להשתמש בו:

{{!-- הצג וערוך שדה משתמש מותאם אישית (למשל, "הערת פרופיל") עבור user_field_5 --}}
{{#if this.fieldValue}}
  <div>
    <strong>הערת פרופיל:</strong> {{this.fieldValue}}
  </div>
{{else}}
  {{#if this.canEdit}}
    <div class="profile-note-display empty">
      <em>לא הוגדרה הערת פרופיל</em>
    </div>
  {{/if}}
{{/if}}

{{#if this.canEdit}}
  {{#unless this.editing}}
    <button class="btn btn-primary btn-small" {{on "click" this.startEdit}}>
      {{#if this.fieldValue}}ערוך{{else}}הוסף{{/if}} הערת פרופיל
    </button>
  {{/unless}}
{{/if}}

{{#if this.editing}}
  <form {{on "submit" this.save}}>
    <textarea
      rows="4"
      style="width:100%;"
      value={{this.editValue}}
      {{on "input" this.updateEdit}}
      autofocus
    ></textarea>
    <br>
    <button type="submit" class="btn btn-primary btn-small">שמור</button>
    <button type="button" class="btn btn-conditional btn-small" {{on "click" this.cancelEdit}}>בטל</button>
  </form>
{{/if}}

מה יכולה להיות הבעיה האפשרית?

אני לא חושב שיש לנו מספיק מידע כדי לעזור בהתבסס על התבנית הזו בלבד. כיצד this.fieldValue מוגדר?

אם תזין user_field_5 בהגדרת האתר Public user custom fields… תוכל לגשת אליו מנקודת יציאה זו של התוסף

או בתבנית שלך כמו: {{@user.custom_fields.user_field_5}}

או ב-JS שלך כמו: this.args.user?.custom_fields?.user_field_5