How to Load TouchUI dialog Specific Clientlibs
For touch UI dialog we can load specific client libs by using extraClientlibs property to the cq:dialog node.
see below snippet
Using extraClientlibs property
cq: dialog: {
jcr: primaryType: "nt:unstructured",
jcr: title: "Page",
extraClientlibs: ["category1","category2"],
mode: "edit",
sling: resourceType: "cq/gui/components/authoring/dialog"
}
Use categories property to load both CSS and JS.
Use js property to load only JS
Use CSS property to load only CSS
Using Granite Resource
Add node to cq:dialog with granite component reference (/libs/granite/ui/components/coral/foundation/includeclientlibs)Use categories property to load both CSS and JS.
Use js property to load only JS
Use CSS property to load only CSS
{
jcr: primaryType: "nt:unstructured",
categories: ["category1","category2"],
sling: resourceType: "/libs/granite/ui/components/coral/foundation/includeclientlibs"
}
ReplyDeleteIt works just in case of modification of properties, on the other hand it does not work in the case of creation of the page(/mnt/overlay/wcm/core/content/sites/createpagewizard.html).
Do you have a solution for it to work in the creation(createpagewizard) mode.
Thank you
EL HOUCINE MANZAT have you tried second approach Using Granite Resource (/libs/granite/ui/components/coral/foundation/includeclientlibs)?
DeleteWhat should be the node name if i'm going with Using Granite Resource (/libs/granite/ui/components/coral/foundation/includeclientlibs) approach?
ReplyDeleteNode name can be anything
DeleteWhen I create a page template, the styles I added with the extraClientlibs property are not loaded, however, if I create the page and the go to the properties edition, the styles are loaded. Why is this?
ReplyDelete