Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to load clientlibs (to setup default values to page properties, show/hide fields) while creating a page using template in AEM 6.5?

Avatar

Level 2

Hi Team,

I did try to create Clientlib with categories="[cq.authoring.editor]" and load while creating a page using template, but it didn't load.

where as the same clientlib loading while editing page properties with custom category.

My requirement is to do below activities while creating a page,

  1. setup current date value to a date field.
  2. show/hide a field based on other field default value.

can you guys let me know what did i miss here?

 

Thanks,

Raju.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 


This is how I have set it:

EstebanBustamante_2-1716821042128.png

 

EstebanBustamante_1-1716820994136.png


It is working fine for me:

EstebanBustamante_0-1716820772188.png

 

Hope this helps



Esteban Bustamante

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,


You could simply create your own clientlib and then include it in the page properties' dialog, this article explains how to do it: https://adapttoaem.blogspot.com/2021/02/aem-create-custom-touch-dialog-ui-edit.html 

 

Let me know if you have any issues.


Hope this helps.



Esteban Bustamante

Avatar

Level 2

Hi @EstebanBustamante ,

Thanks for your quick response.

I tried the same thing, but didn't work.

here are more details -

Clientlibs -

Screenshot 2024-05-27 at 16.01.52.png

 

Clientlibs are not loading while creating page -

CLientlib_notloading.png

Same clientlibs are loading while editing page properties -

Clientlib_loading_editpageproperties.png

Avatar

Correct answer by
Community Advisor

Hi, 


This is how I have set it:

EstebanBustamante_2-1716821042128.png

 

EstebanBustamante_1-1716820994136.png


It is working fine for me:

EstebanBustamante_0-1716820772188.png

 

Hope this helps



Esteban Bustamante

Avatar

Level 2

@EstebanBustamante ,

 

Thanks again for quick turn around!

Yes, it is working.

So, this means -

  1. Set a property extraClientlibs to cq:dialog node and add category as value

             - is limited to load Clientlibs at component dialog level.

    2. Create node(nt:unstructured) and use granite/ui/components/coral/foundation/includeclientlibs

            - is to load Clientlibs at page component dialog level.

 

Correct me if my understanding is wrong.