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