This tutorial enables you to quickly create a website with CQ5, based on an existing website. It is mainly targeted at Day Pre-Sales staff and Day Partners preparing Proof Of Concept for a project. You only need CQ5 WCM, CRXDE and a Web browser.
In CRX Explorer, copy the node apps/geometrixx, name the target node <customername> and paste it under apps.
Set the title (jcr:title property) of the Template apps/<customername>/templates/contentpage to <Customername> Content Page Template.
Replace the thumbnail /apps/<customername>/templates/contentpage/thumbnail.png with one representing your Template.
Create a PNG image, 128 x 98 px big.
In your file system, copy the image and paste it into /apps/<customername>/templates/contentpage/ .
Set the property allowedPaths of the Template /apps/<customername>/templates/contentpage to /content(/.*)? to make the template available for all the new pages below /content.
Set the property sling:resourceType of the node /apps/<customername>/templates/contentpage/jcr:content to <customername>/components/contentpage.
In CRXDE, under the Component /apps/<customername>/components/contentpage, create the file contentpage.jsp.
Copy/paste following code into the script contentpage.jsp:<%@page session="false" contentType="text/html; charset=utf-8" %><% %><%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><% %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <%@include file="/libs/foundation/global.jsp" %><% %><head> <cq:include script="/libs/wcm/core/components/init/init.jsp"/> <% currentDesign.writeCssIncludes(out); %> MyCustomerHead </head> <body> MyCustomerBody </body> </html>
In your browser, open the Website tab.
Under Websites, create a new page with the Title www.<customername>.com, the label <customername> and the <Customername> Content Page Template.
Under the Page www.<customername>.com, create a new page with the Title English, the label en and the <Customername> Content Page Template. If needed, create one Page with the Title French, the label fr and one Page the Title German, the label de.
Under the Page English, create as many pages as needed in order to reproduce the site map of your customer site.
In CRX Explorer, copy the node /etc/designs/geometrixx, name the target node <customername> and paste it under /etc/designs.
In contentpage.jsp, insert <% currentDesign.writeCssIncludes(out); %> at the appropriate location.
In CRXDE, open the file /etc/designs/<customername>/static.css and adapt the styles to your needs.
Link your pages to the <customername> designer: in CRX Explorer, select the node /content/<customername>/jcr:content. Double-click Property cq:designPath and set /etc/designs/<customername> as Value.
In Firefox, browse to the page that you want to import, select Save Page As …, enter <customername> as Filename and save it on your desktop.
Test the downloaded website on your desktop: open the downloaded <customername>.htm file in your browser and compare the result with the original website. If it is different, open the file in a text editor and fix the problems. Problems are often caused by paths for css files and images that need to be correctly reset.
In your filesystem, zip all the resources of your webpage (html, css, images, ...).
In CRX Explorer, under the node /apps/<customername>/components/contentpage, create a New Node: set the Name to resources and the Type to sling:Folder.
In CRX Content Loader, import the zip file and expand it into the node /apps/<customername>/components/contentpage/resources:
Browse to http://localhost:4502/crx/loader/index.jsp.
Click Browse beside Root path for import:, browse to the node /apps/<customername>/components/contentpage/resources and click Open.
Click Browse beside File to upload:, browse to your zip file and click Open.
Check Auto-Expand and Expand file content directly below selected root checkboxes.
In a normal project setup, the resources wouldn't be placed under the Component. It is only done here to maximize your efficiency.
In CRXDE, open the file <customername>.html and copy the content between the <head> and </head> tags. In the script contentpage.jsp, select MyCustomerHead and paste the previously copied content.
In the file <customername>.html, copy the content between the <body> and </body> tags. In the script contentpage.jsp, select MyCustomerBody and paste the previously copied content.
In the script contentpage.jsp, reset the paths of the css files and the images by replacing: <customername>_files with: /apps/<customername>/components/contentpage/resources
Make sure that the names of your resources don't start with _ (underscore)..
In the script contentpage.jsp, replace all external links with internal links. This way the external links don't appear broken when your machine is not online.
In your browser, in the Website tab, open the page www.<customername>.com. It should display your <customername> web page.
In CRXDE, in the file contentpage.jsp, select the content of the middle part of the page and replace it with: <cq:include path="par" resourceType="foundation/components/parsys" />. The content has been replaced by the parsys Foundation Component.
In your browser, refresh your page. The features of the Paragraph System are now available to you: you can include other Components, for example, Flash, Text or Text Image.
By following the previous steps, you can add other CQ Foundation Components as for example topnav or toolnav.
In your browser, in the Website tab, open a page of your choice from your application. Copy content from the original web page and paste it into your page.
Adapt the design to look like the design of the original website.
In your browser, download about 20 resources (pictures, banners, pdf, …) from the original website: open a Google page, type site:<customer-url>, click search and click the Images tab. Save the desired resources on your computer.
In your filesystem, zip all the resources.
In CRX Content Loader, import the zip file and expand it into the node content/dam/<customername>. The resources are now in the Media Library and available in the Content Finder, when browsing through the Pages.
Thank you for submitting your feedback.