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」,作為顯示頭像原本會變成何處的視覺指標。
<!-- do not display avatar with comment
<aside class="scf-comment-author">
<img class="scf-comment-avatar {{#if topLevel}}withTopLevel{{/if}}" src="{{author.avatarUrl}}"></img>
使用復寫工具將重疊的註解元件推送至發佈執行個體。
更強健的復寫形式是在套件管理器中建立套件,並啟用它。 可匯出和封存套件。
從全局導航中,選擇工具>部署>複製,然後選擇激活樹。
對於起始路徑,請輸入/apps/social/commons
並選擇激活。
如果您以管理員身分登入發佈執行個體(例如,以管理員/管理員身分登入http://localhost:4503/crx/de),即可驗證覆蓋的元件是否位於該處。
如果您登出並重新登入為aaron.mcdonald@mailinator.com/password
,然後重新整理頁面,您會看到張貼的留言不再以頭像顯示,而是顯示簡單的「xxx」。