אתה מציג תוכן עזרה עבור גרסה:

Now that the components for the custom comment system in the application directory (/apps) are in place, with a resourceSuperType referencing the default comment system and the custom Model/View registered, it is possible to modify the implementation.  

For a simple demonstration, a visual feature, the avatar shown of the signed-in user who posts a comment, is removed.

הערה:

To make use of the extension, the instance of the comment system in a website to be affected (/content) must set its resourceType to be the custom comment system.

Modify the HBS Scripts

Using CRXDE Lite :

  • open /apps/custom/components/comments/comment/comment.hbs
    • comment out the tag which includes the avatar for a comment post (~ line 21) :
      <!--
          <<img class="scf-comment-avatar {{#if topLevel}}withTopLevel{{/if}}" src="{{author.avatarUrl}}"></img>
      -->
  • open /apps/custom/components/comments/comments.hbs
    • comment out the tag which includes the avatar for the next comment entry (~ line 44) :
      <!--
          <img class="scf-composer-avatar" src="{{loggedInUser.avatarUrl}}"></img>
      -->
  • select Save All

Replicate Custom App

After the application has been modified, it is necessary to re-replicate the custom component.

One way to do so is 

  • from the main menu
    • select Tools > Operations > Replication
    • select Activate Tree
    • set Start Path: to /apps/custom
    • uncheck Only Modified
    • select Activate button

View Modified Comment on Published Sample Page

Continuing the experience on the publish instance, still signed in as the same user, it is now possible to refresh the page in the publish environment to view the modification to remove the avatar :

chlimage_1

Sample Comment Extension Package

Attached is a package of the custom comments application created in this tutorial.

הורד

עבודה זו בוצעה ברישיון של Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  הודעות המתפרסמות ב- Twitter™‎ ו- Facebook אינן מכוסות בתנאי Creative Commons.

הצהרות משפטיות   |   מדיניות פרטיות מקוונת