Expand my Community achievements bar.

SOLVED

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

Avatar

Level 7

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.

 

tushaar_srivastava_0-1676268030764.png

 

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. 

tushaar_srivastava_1-1676268031050.png

tushaar_srivastava_3-1676268153202.png

 

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-i...

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?

tushaar_srivastava_0-1676269001268.png

 


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

Thanks 

@kautuk_sahni  @arunpatidar  @Theo_Pendle @Kiran_Vedantam 

Thanks,

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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
    crx-apps.jpg
  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><%​

    card-view-mod.jpg
  3. Save changes.

The result:

omin-search-results.jpg

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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
    crx-apps.jpg
  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><%​

    card-view-mod.jpg
  3. Save changes.

The result:

omin-search-results.jpg

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

Avatar

Level 7

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