Why initialize the WCM?
The WCM initialization script performs all necessary steps to provide the whole WCM functionality on a page, including: Dialogs, Widgets, WCM CSS & JS, Sidekick, etc. Some WCM functionality such as the Page properties (no Dialog defined yet) may not work when only the initialization script is included.
How to initialize the WCM in your “Page” Component:
- Open the file contentpage.jsp, and enter some JSP code, similar to below, adding to the <head> section an include of the initialization script – then Save.
contentpage.jsp
<%@include file=”/libs/foundation/global.jsp”%>
<html>
<head>
<title>Sample Page</title>
<cq:include script=”/libs/wcm/core/components/init/init.jsp”/>
</head>
<cq:include script=”body.jsp” />
</html>
- Test your script by requesting a Page in CQ5 Siteadmin that implements this “Page” Component.
- If successful, you should now see the Sidekick appear, which will give authors the ability to manage content.
NOTE
For developers of previous CQ5 versions, you will notice that the location of the init.jsp has moved from /libs/wcm/init/init.jsp to its current location.
Congratulations! You have successfully initialized the WCM, and all of its related tools.
Thanks