How to Load TouchUI dialog Specific Clientlibs

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"
}

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"
}

5 comments:


  1. It 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

    ReplyDelete
    Replies
    1. EL HOUCINE MANZAT have you tried second approach Using Granite Resource (/libs/granite/ui/components/coral/foundation/includeclientlibs)?

      Delete
  2. What should be the node name if i'm going with Using Granite Resource (/libs/granite/ui/components/coral/foundation/includeclientlibs) approach?

    ReplyDelete
  3. When 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