Skip to content

Commit

Permalink
Content Fragment List component : Property Name is getting displayed …
Browse files Browse the repository at this point in the history
…to users rather than Field Label

For multi text field look for cfm-element key or fallback on the default value.
  • Loading branch information
HollywoodTonight committed Jul 10, 2023
1 parent 8e178c7 commit b2d5684
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ protected void doGet(@NotNull SlingHttpServletRequest request, @NotNull SlingHtt
ValueMap valueMap = elementResource.getValueMap();
String valueValue = valueMap.get("name", "");
String textValue = valueMap.get("fieldLabel", valueValue);
if (textValue.equals(valueValue)) {
textValue = valueMap.get("cfm-element", valueValue);
if (textValue == null || textValue.isEmpty()) {
textValue = valueValue;
}
}
if (isOrderBy && StringUtils.isNotEmpty(valueValue)) {
valueValue = "jcr:content/data/master/" + valueValue;
}
Expand Down

0 comments on commit b2d5684

Please sign in to comment.