Create Nodes create-nodes

Overlay the comment system with a custom version by copying the minimal number of files necessary from /libs into /apps and modifying them in /apps.

The contents of the /libs folder are never edited because any reinstall or upgrade may delete or replace the /libs folder while the contents of the /apps folder is left untouched.

Using CRXDE Lite on an author instance, begin by creating a path in the /apps folder which is identical to the path to the overlaid components in the /libs folder.

The path being duplicated is:

  • /libs/social/commons/components/hbs/comments/comment

Some nodes in the path are folders and some are components.

  1. Browse to http://localhost:4502/crx/de/index.jsp

  2. Create /apps/social (if it does not exist already)

    • Select /apps node
    • Create > Folder
      • Enter Name: social
  3. Select social node

    • Create > Folder
      • Enter Name: commons
  4. Select commons node

    • Create > Folder
      • Enter Name: components
  5. Select components node

    • Create > Folder.
      • Enter Name: hbs
  6. Select hbs node

    • Create > Create Component

      • Enter Label: comments
      • Enter Title: Comments
      • Enter Description: List of comments without showing avatars
      • Super Type: social/commons/components/comments
      • Enter Group: Communities
      • Click Next until OK
  7. Select comments node

    • Create > Create Component

      • Enter Label: comment
      • Enter Title: Comment
      • Enter Description: A comment instance without avatars
      • Super Type: social/commons/components/comments/comment
      • Enter Group: .hidden
      • Click Next until OK
    • Select Save All

  8. Delete the default comments.jsp

    • Select node /apps/social/commons/components/hbs/comments/comments.jsp
    • Select Delete
  9. Delete the default comment.jsp

    • select node /apps/social/commons/components/hbs/comments/comment/comment.jsp
    • Select Delete
    • Select Save All
To preserve the inheritance chain, the Super Type (property sling:resourceSuperType) of the overlay components are set to the same value as the Super Type of the components being overlaid, in this case:
  • social/commons/components/comments
  • social/commons/components/comments/comment

The overlay’s own Type(property sling:resourceType) must be a relative self-reference so that any content not found in /apps is then looked for in /libs.

  • Name: sling:resourceType
  • Type: String
  • Value: social/commons/components/hbs/comments
  1. Select the green [+] Add

    • Name: sling:resourceType
    • Type: String
    • Value: social/commons/components/hbs/comments/comment
  2. Select the green [+] Add

    • Select Save All