Create the Child Comment Component

These directions set Group to .hidden as only the parent component should be included within a page.

The deletion of the auto-created JSP file is because the default HBS file is used instead.

  1. Navigate to the /apps/custom/components/comments node

  2. Right-click the node

    • Select Create > Component…

      • Label: comment
      • Title: Alt Comment
      • Description: Alternative comment style
      • Super Type: social/commons/components/hbs/comments/comment
      • Group: *.hidden*
    • Select Next

    • Select Next

    • Select Next

    • Select OK

  3. Expand the node that was created: /apps/custom/components/comments/comment

  4. Select Save All

  5. Right-click comment.jsp

  6. Select Delete

  7. Select Save All

create-child-component

create-component-crxde

Copy and Modify the Default HBS Scripts

Using CRXDE Lite:

Create a Client Library Folder

To avoid having to include this client library, the categories value for the default comment system’s clientlib can be used ( cq.social.author.hbs.comments). However, this clientlib would then have to be included for all instances of the default component, too.

Using CRXDE Lite:

  • Select /apps/custom/components/comments node

  • Select Create Node

    • Name: clientlibs

    • Type: cq:ClientLibraryFolder

    • Add to Properties tab:

      • Name categories Type String Value cq.social.author.hbs.comments Multi
      • Name dependencies Type String Value cq.social.scf Multi
  • Select Save All

  • With /apps/custom/components/comments/clientlibs node selected, create three files:

    • Name: css.txt
    • Name: js.txt
    • Name: customcommentsystem.js
  • Enter ‘customcommentsystem.js’ as the content of js.txt

  • Select Save All

comments-clientlibs

Register the SCF Model & View

When extending (overriding) an SCF component, the resourceType is different (overlaying uses the relative search mechanism that searches through /apps before /libs so that the resourceType remains the same). This is why it is necessary to write JavaScript (in the client library) to register the SCF JS model and view for the custom resourceType.

Enter the following text as the content of customcommentsystem.js: