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"
}
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 the only CSS
{
jcr: primaryType: "nt:unstructured",
categories: ["category1","category2"],
sling: resourceType: "/libs/granite/ui/components/coral/foundation/includeclientlibs"
}
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"
}
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 the only CSS
{
jcr: primaryType: "nt:unstructured",
categories: ["category1","category2"],
sling: resourceType: "/libs/granite/ui/components/coral/foundation/includeclientlibs"
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.