Need to combine custom fields with default fields on user profile page | Community
Skip to main content
robin97009708
April 12, 2018
Solved

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

  • April 12, 2018
  • 2 replies
  • 1654 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rahul_Bhardwaj

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-communities-extension…

Hope that helps!

2 replies

Rahul_Bhardwaj
Adobe Employee
Rahul_BhardwajAdobe EmployeeAccepted solution
Adobe Employee
April 20, 2018

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-communities-extension…

Hope that helps!

smacdonald2008
Level 10
April 20, 2018

Thank you Rahul Bhardwaj for providing your input.