comment.hbs指令碼負責建立每個註解的整體HTML。
若要不在每個張貼的留言旁顯示頭像:
將comment.hbs
從libs
複製到apps
/libs/social/commons/components/hbs/comments/comment/comment.hbs
/apps/social/commons/components/hbs/comments/comment
開啟覆蓋的comment.hbs
/apps/social/commons/components/hbs/comments/comment folder
中的節點comment.hbs
查找以下行並刪除或注釋它們:
<aside class="scf-comment-author">
<img class="scf-comment-avatar {{#if topLevel}}withTopLevel{{/if}}" src="{{author.avatarUrl}}"></img>
請刪除這些行,或用<!--
和-->
將它們圍起來以注釋掉。 此外,字元「xxx」也會加入,作為頭像原本所在位置的視覺指標。
xxx
<!-- do not display avatar with comment
<aside class="scf-comment-author">
<img class="scf-comment-avatar {{#if topLevel}}withTopLevel{{/if}}" src="{{author.avatarUrl}}"></img>
使用複製工具將覆蓋的注釋元件推送到發佈實例。
更強穩的複製形式是在「包管理器」中建立包,並activate。 可以導出和歸檔包。
在全局導航中,選擇工具 > 部署 > 複製,然後按一下激活樹。
對於開始路徑,輸入/apps/social/commons
並選擇激活。
如果您以管理員身分登入發佈例項,例如以管理員/管理員身分登入https://localhost:4503/crx/de,則可驗證覆蓋的元件是否在此。
如果您登出並重新登入為aaron.mcdonald@mailinator.com/password
並重新整理頁面,您會發現張貼的留言不再顯示為頭像,而是顯示簡單的「xxx」。