#2 Content Project Organization

Presented by David G.

Walks through how to build out the core organizational structure of a new Adobe AEM projects Content project.

.content.xml Snippet

<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" 
          xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType=""/>

Apps / Global

Include the “app-specific” global.jsp at the top of each JSP in the project.

<%@include file="/apps/aemcasts/demo/global/global.jsp"%>

  • /apps/aemcasts/demo/global/global.jsp

Initial file contents:

<%@include file="/libs/foundation/global.jsp"%>

Apps / Content Components

Content Components can be organized by function. This will be different based on the type of site created. Common categorizations include:

  • /apps/aemcasts/demo/components/content/accounts
  • /apps/aemcasts/demo/components/content/general
  • /apps/aemcasts/demo/components/content/navigation
  • /apps/aemcasts/demo/components/content/profile
  • /apps/aemcasts/demo/components/content/site

If cannot can define clean categorization place all components in a flat structure under

  • /apps/aemcasts/demo/components/content

Example:

  • /apps/aemcasts/demo/components/content/title
  • /apps/aemcasts/demo/components/content/image
  • /apps/aemcasts/demo/components/content/featured-article
  • /apps/aemcasts/demo/components/content/q-n-a

Apps / Page Components

Page components represent implementations of Pages. Common categorizations include:

  • /apps/aemcasts/demo/components/page/content
  • /apps/aemcasts/demo/components/page/landing
  • /apps/aemcasts/demo/components/page/site

If you cannot define clean categorization place all page compoentns in a flat structure under

  • /apps/aemcasts/demo/components/page

Example:

  • /apps/aemcasts/demo/components/page/base-page
  • /apps/aemcasts/demo/components/page/home-page
  • /apps/aemcasts/demo/components/page/article-page

Apps / Templates

Templates available for use by Authors.

  • /apps/aemcasts/demo/templates

Apps / Widgets

Authoring-specific JavaScript and CSS

  • /apps/aemcasts/demo/widgets
    • jcr:primaryType: “cq:ClientLibraryFolder”
    • categories: “cq.widgets”
  • /apps/aemcasts/demo/widgets/css.txt
  • /apps/aemcasts/demo/widgets/js.txt
  • /apps/aemcasts/demo/widgets/source
  • /apps/aemcasts/demo/widgets/source/css
  • /apps/aemcasts/demo/widgets/source/jss

Clientlibs

Clientlibs include brand specific CSS, JavaScript and Static images.

  • /etc/clientlibs/aemcasts/demo/all
    • jcr:primaryType: cq:ClientLibraryFolder
    • categories: [aemcasts.demo.all]
    • embed: [aemcasts.demo.main]
  • /etc/clientlibs/aemcasts/demo/main
    • jcr:primaryType: cq:ClientLibraryFolder
    • categories: [aemcasts.demo.main]
  • /apps/aemcasts/demo/widgets/css.txt
  • /apps/aemcasts/demo/widgets/js.txt
  • /apps/aemcasts/demo/widgets/source
  • /apps/aemcasts/demo/widgets/source/css
  • /apps/aemcasts/demo/widgets/source/jss