變更外觀

修改指令碼

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

不顯示每個張貼的評論旁的頭像:

  1. 複製 comment.hbslibsapps

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

    • 連按兩下節點 comment.hbs/apps/social/commons/components/hbs/comments/comment folder
  3. 尋找下列行,然後刪除或註解它們:

  <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 並選取 啟動.

verify-content-template

檢視結果

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

如果您登出後重新登入, aaron.mcdonald@mailinator.com/password 和重新整理頁面,您會發現貼出的評論不再以頭像顯示,而是顯示簡單的「xxx」。

create-template-component

本頁內容