更改外觀

修改指令碼

comment.hbs指令碼負責為每個注釋建立整體HTML。

若要不在每個已張貼留言旁顯示頭像:

  1. comment.hbslibs複製到apps

    1. 選取 /libs/social/commons/components/hbs/comments/comment/comment.hbs
    2. 選擇​複製
    3. 選取 /apps/social/commons/components/hbs/comments/comment
    4. 選擇​貼上
  2. 開啟覆蓋的comment.hbs

    • 按兩下/apps/social/commons/components/hbs/comments/comment folder中的節點comment.hbs
  3. 找到以下行,然後刪除或注釋這些行:

    <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並選擇​激活

chlimage_1-42

查看結果

如果您以管理員身分登入發佈執行個體(例如,以管理員/管理員身分登入http://localhost:4503/crx/de),即可驗證覆蓋的元件是否位於該處。

如果您登出並重新登入為aaron.mcdonald@mailinator.com/password,然後重新整理頁面,您會看到張貼的留言不再以頭像顯示,而是顯示簡單的「xxx」。

chlimage_1-43

本頁內容