Addition of Locale field in Card which gets in search within sites [AEM6.5] | Community
Skip to main content
tushaar_srivastava
New Participant
February 13, 2023
Solved

Addition of Locale field in Card which gets in search within sites [AEM6.5]

  • February 13, 2023
  • 2 replies
  • 910 views

Hi All,
I need to add the locale next to published/unpublished status in tile when we use search for any resource.
Example : there could be multiple page of we retails in different locales and I need to search which we retails belongs to which language.

 

 

Likewise another example if we search for Men page which is under we retails we can see it is in candan and us en as well. 

 

but we wan to add more details in tiles which we get while search.


It is similar to  : https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/addition-of-locale-field-in-tile-which-gets-in-search-within/m-p/569686#M142277

Can see it is loading from : granite/ui/content/shell/omnisearch/searchresults.html

But it is deprecated in 6.5, in that case which node to be overlay to add the Locale information in next to publish/unpublish status?

 


Could you please suggest me the best way to achive this requirement

Thanks 

@kautuk_sahni  @arunpatidar  @theo_pendle @kiran_vedantam 

Thanks,

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

Hi @tushaar_srivastava,

In AEM 6.5 you will have to overlay following path: /libs/cq/gui/components/coral/admin/page/card/card.jsp that is responsible to display card view in search results. Please be aware that it could be used also in other views, so this change could affect other places as well. It will be good to also write some conditions in case additional value should not be displayed.

Step by step instruction:

  1. Overlay /libs/cq/gui/components/coral/admin/page/card/card.jsp as a result you should get /apps/cq/gui/components/coral/admin/page/card/card.jsp

  2. Edit card.jsp file, and add below modification:
    %><coral-card-propertylist><coral-card-property><%= xssAPI.encodeForHTMLAttr(cqPage.getLanguage().getLanguage()) %></coral-card-property></coral-card-propertylist><%​
  3. Save changes.

The result:

Of course you can choose different property etc, above example use what Page object provides.

2 replies

lukasz-m
lukasz-mAccepted solution
New Participant
February 15, 2023

Hi @tushaar_srivastava,

In AEM 6.5 you will have to overlay following path: /libs/cq/gui/components/coral/admin/page/card/card.jsp that is responsible to display card view in search results. Please be aware that it could be used also in other views, so this change could affect other places as well. It will be good to also write some conditions in case additional value should not be displayed.

Step by step instruction:

  1. Overlay /libs/cq/gui/components/coral/admin/page/card/card.jsp as a result you should get /apps/cq/gui/components/coral/admin/page/card/card.jsp

  2. Edit card.jsp file, and add below modification:
    %><coral-card-propertylist><coral-card-property><%= xssAPI.encodeForHTMLAttr(cqPage.getLanguage().getLanguage()) %></coral-card-property></coral-card-propertylist><%​
  3. Save changes.

The result:

Of course you can choose different property etc, above example use what Page object provides.

tushaar_srivastava
New Participant
February 16, 2023

Thank you @lukasz-m  this really helped, this changes can effect globally whithin instance, but while add some condition we can retsrict to make use of within certian paths, Thanks again 😊

kautuk_sahni
Employee
February 15, 2023