Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

AEM 6.5 - Clientlib is not getting embedded while creating a page

JakeCham
Level 4
Level 4

Hi,

 

I have a Clientlib folder which includes scripts. It was embeded into cq:dialog in page (apps/aaa/components/structure/page) using extraClientlibs->categories.Problem is while page creation , This clientlib doesn't embed.it is embedding after page creation only.How I can embed it while creating the page ?

 

Thanks in advance.

11 Replies
Anudeep_Garnepudi
Community Advisor
Community Advisor

@JakeCham 

Clientlibs you include as part of dialog(cq:dialog) will only load once you open the dialog. Include client lib in page rendering html/jsp or use cq.authoring.editor category to your clientlib.

JakeCham
Level 4
Level 4

Hi @Anudeep_Garnepudi , Thanks for the reply.Script inside clientlib should work on cq dialog properties while creating the pages(apps/aaa/components/structure/page)).in that case what I have to follow ? After creating the page when i go the edit page properties, script already there.only problem is while creating I want that clientlibs to embed on cq:dialog page properties

Anudeep_Garnepudi
Community Advisor
Community Advisor
@JakeCham Try using granite.ui.quickactions category, this will be loaded in create page interface
JakeCham
Level 4
Level 4
@Anudeep_Garnepudi I have tried adding granite.ui.quickactions into extraClientlibs.still not working.
JakeCham
Level 4
Level 4

@Anudeep_Garnepudi granite.ui.quickactions was added inside cq:dialog->extraClientlibs as a value.if it is you asked me to try then it is not working.

Anudeep_Garnepudi
Community Advisor
Community Advisor
@JakeCham Please add category granite.ui.quickactions to your cq:clientLibraryFolder. No need to add that category to your cq:dialog.
JakeCham
Level 4
Level 4
@Anudeep_Garnepudi Thanks a lot. it is working.Can i know the behavior of the granite.ui.quickactions.Is it adding particular client library into page root only ?
Anudeep_Garnepudi
Community Advisor
Community Advisor
@JakeCham The actual behaviour of granite.ui.quickactions is to show/hide the child pages and actions of specific in sites.html. But here we are just using that category to load our clientlib on edit interface. As our client will be loaded as separate as script on to the page(will not be included as part of actual granite.ui.quickactions code) we are good. But make sure your script does not throw any errors.
JakeCham
Level 4
Level 4
@Anudeep_Garnepudi Really appreciate if you can put a link that I can read about granite.ui.quickactions
JakeCham
Level 4
Level 4
Hi @Anudeep_Garnepudi Client lib is getting embedded after adding granite.ui.quickactions category.But you know which event need to be fired in jquery while creating a page.I have tried $(document).on("pagecreate",function(){ but it is not working ?