Skip to content

quantizor/CQ5-RequireJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

CQ5-RequireJS

JSP code to enable dynamic creation of requireJS calls based on the components dropped in a CQ5 page template.

  1. Place this code in the head or headlibs.jsp file of your page template component.

  2. Add a String[] (multi) property called "requireJS" to your components that have a requireJS configuration.

For example (via .content.xml template file):

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
          xmlns:cq="http://www.day.com/jcr/cq/1.0"    
          xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="cq:Component"
          jcr:title="Color Picker"
          sling:resourceSuperType="foundation/components/parbase"
          allowedParents="[*/parsys]"
          componentGroup="My Components"
          requireJS="[jquery,color_picker]" />
  1. Tweak the script tag at the bottom to match the location of your require.min.js and configuration files.

  2. Enjoy!

About

☕️ JSP code to enable dynamic creation of requireJS calls based on the components dropped in a CQ5 page template.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages