1

I am creating a new template and then a page from SCRATCH in CQ5. But I can't find the option to add my own CSS/images/JS to the page.

I mean a place to add/upload the actual files.

All the tutorials I've seen talk only about creating a template based on an existing template. Is there any tutorial on how to create the page from scratch ?

Riju Mahna
  • 6,718
  • 12
  • 52
  • 91
  • have you added "from scratch" to your google query? – Gung Foo Feb 12 '13 at 12:35
  • Yes, and the best result is this page : http://dev.day.com/docs/v5_1/html-resources/cq5_howto_a_collection/cq5_howto_a_collection.html – Riju Mahna Feb 12 '13 at 12:36
  • I don't know of a tutorial on creating a page template "from scratch." Since every template depends so much on the CQ5 framework, that seems like a bootless undertaking. As far as your CSS and JavaScript, see the answer that I am preparing. – David Gorsline Feb 12 '13 at 16:59

2 Answers2

5

Your CSS and JavaScript go into nodes under /etc/designs/[your project's name]/clientlibs. (Ordinarily, you would set the page property cq:designPath of your content's home page to be /etc/designs/[your project's name] to point to this.) It's common practice to set up a subfolder of clientlibs called default, where your general-purpose style sheets and JavaScript go; you can set up other clientlibs for special-case script and style sheets. The simplest way to incorporate your script and style sheets into your page template is the <cq:includeClientLib> JSP tag.

The Adobe docs on clientlibs will also be useful to you, and explains how to use the tag.

David Gorsline
  • 4,933
  • 12
  • 31
  • 36
3

@David , thanks for your answer, but for now, I got a better way to add and then use external files using WebDAV with CQ5.

The basic integration of WebDAV with CQ5 application is mentioned in this page

Riju Mahna
  • 6,718
  • 12
  • 52
  • 91