Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Need to combine custom fields with default fields on user profile page

Avatar

Level 1

I have an overlay for the user profile at /apps/social/console/components/hbs/userprofile/userprofile.hbs.

This page contains a component that brings in data from the user's custom profile to display on the same page as the user's default AEM profile.

The client wants to rearrange the order in which the fields display, which means intermixing custom and default fields.

How do I access the model to bring in the custom data, not as a component but as individual data fields (ex. customProfile.middleinitial) that can be called like the default fields in the HBS (ex: {{profileProperties.gender}})?

This is a simple matter with HTL, which is how the current component works, but I can't find any references for how to do this with HBS.

1463885_pastedImage_0.png

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

1. The client wants to rearrange the order in which the fields display, which means intermixing custom and default fields.

2. How do I access the model to bring in the custom data, not as a component but as individual data fields (ex. customProfile.middleinitial) that can be called like the default fields in the HBS (ex: {{profileProperties.gender}})?

Both #1 and #2 are unrelated, which also means #2 is not a way to achieve #1.
#1 can be achieved by rearranging fields in hbs in overlaid file.
If #2 is also a separate requirement, you have to extend the respective community. Refer [0] for documentation and [1] for example code.

[0] - Server-side Customization

[1] - aem-communities-extensions/aem-communities-journal-extension at master · Adobe-Marketing-Cloud/aem-c...

Hope that helps!

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi,

1. The client wants to rearrange the order in which the fields display, which means intermixing custom and default fields.

2. How do I access the model to bring in the custom data, not as a component but as individual data fields (ex. customProfile.middleinitial) that can be called like the default fields in the HBS (ex: {{profileProperties.gender}})?

Both #1 and #2 are unrelated, which also means #2 is not a way to achieve #1.
#1 can be achieved by rearranging fields in hbs in overlaid file.
If #2 is also a separate requirement, you have to extend the respective community. Refer [0] for documentation and [1] for example code.

[0] - Server-side Customization

[1] - aem-communities-extensions/aem-communities-journal-extension at master · Adobe-Marketing-Cloud/aem-c...

Hope that helps!

Avatar

Level 10

Thank you Rahul Bhardwaj for providing your input.