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
comment.hbs
在 /apps/social/commons/components/hbs/comments/comment folder
尋找下列行,然後刪除或註解它們:
<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>
使用復寫工具將覆蓋的註解元件推送至發佈例項。
更強大的復寫形式是在封裝管理員中建立封裝,並且 啟用 it. 套件可以匯出和封存。
在全域導覽中選取 工具 > 部署 > 復寫 並按一下 啟動樹狀結構.
開始路徑請輸入 /apps/social/commons
並選取 啟動.
如果您以管理員身分(例如https://localhost:4503/crx/de )登入發佈執行個體(例如,以管理員/管理員身分),您可以驗證覆蓋的元件是否存在。
如果您登出後重新登入, aaron.mcdonald@mailinator.com/password
和重新整理頁面,您會發現貼出的評論不再以頭像顯示,而是顯示簡單的「xxx」。