隱藏主題的元件和區段版面配置

依照預設,開發網站的人員都可以使用所有元件和區段版面配置。您有時候可能會想要隱藏元件或區段版面配置,以便使用特定主題時,無法使用這些元件或區段版面配置。例如,如果想要不使用任何按鈕元件或滑桿區段版面配置來升級成一致的外觀與感覺,您可以藉由編輯主題的 components.json 檔案,以在主題中將其隱藏。

若要隱藏主題中的元件和區段版面配置:

  1. Oracle Content Management 中,按一下左側導覽功能表中的開發人員
  2. 在「開發人員」頁面中,按一下檢視所有主題
  3. 在「主題」頁面中,選取要修改的主題,然後從滑鼠右鍵功能表中選擇開啟,或按一下動作列中的 「開啟」圖示
  4. 選取 components.json 檔案,然後按一下下載
  5. 在文字編輯器中開啟 components.json 檔案。
  6. 新增物件來指定元件類型和 ID,並將特性 hidden 設為 true
    例如,下列範例項目會隱藏按鈕元件:
    "type":"scs-button",
    "id":"scs-button",
    "hidden":true
    同樣地,下列範例項目會隱藏滑桿區段版面配置:
    "type":"scs-sectionlayout",
    "id":"scs-sl-slider",
    "hidden":true

    components.json 檔案中隱藏按鈕元件和滑桿區段版面配置的完整項目如下:

    [
        {
            "name":"",
            "list":[
                {
                    "type":"scs-button",
                    "id":"scs-button",
                    "hidden":true
                },
                {
                    "type":"scs-sectionlayout",
                    "id":"scs-sl-slider",
                    "hidden":true
                }
            ]
        },
        {
            "name": "Starter",
            "list": [
                {
                    "type": "component",
                    "id": "StarterComponent",
                    "themed": true
                },
                {
                    "type": "component",
                    "id": "StarterFooter",
                    "themed": true
                }
            ]
        }
    ]
  7. 進行所需的變更之後,請將 components.json 檔案上傳至主題以作為新的版本。