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.
Browse to http://localhost:4502/crx/de/index.jsp
Create /apps/social
(if it does not exist already)
/apps
nodesocial
Select social
node
commons
Select commons
node
components
Select components
node
hbs
Select hbs
node
comments
Comments
List of comments without showing avatars
social/commons/components/comments
Communities
Select comments
node
Create > Create Component
comment
Comment
A comment instance without avatars
social/commons/components/comments/comment
.hidden
Select Save All
Delete the default comments.jsp
/apps/social/commons/components/hbs/comments/comments.jsp
Delete the default comment.jsp
/apps/social/commons/components/hbs/comments/comment/comment.jsp
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.
sling:resourceType
String
social/commons/components/hbs/comments
[+] Add
sling:resourceType
String
social/commons/components/hbs/comments/comment
[+] Add