您可以使用 cec create-contentlayout
命令,為 Developer Cloud Service 專案中的內容類型建立內容版面配置。
若要在 Developer Cloud Service 專案中建立內容版面配置:
在終端機視窗中,前往 cec-components
目錄。
輸入 cec create-contentlayout
以查看此命令的選項和範例:
Usage: cec create-contentlayout <name> Creates a content layout based on a content type from a local template or from CEC server. By default, an "overview" content layout is created. Optionally specify -s <style> to create in a different style. Valid values for <style> are: detail overview Options: --contenttype, -c <contenttype> Content layout is based on [required] --template, -t <template> Content type is from --server, -r flag to indicate the content type is from server --style, -s <style> Content layout style --addcustomsettings, -a Add support for custom settings when used in Sites --help, -h Show help [boolean] Examples: cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -t BlogTemplate cec create-contentlayout Blog-Post-Detail-Layout -c Blog-Post -t BlogTemplate -s detail cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -t BlogTemplate -a cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -r cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -r -s detail
輸入下列命令以查看伺服器上可用的內容類型:
cec list-server-content-types
如「用法」中所示,您可以為 Oracle Content Management 伺服器中的內容類型或為 cec-components/src/main/templates
底下之樣板中的內容類型建立內容版面配置。例如,下列命令會為伺服器中的類型建立內容版面配置:
cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -r
您可以編輯下列檔案來修改內容版面配置:
assets/layout.html
此檔案指定 HTML 檢視。請參閱編輯 Mustache 樣板中的內容版面配置。
assets/design.css
此檔案指定內容版面配置的樣式。請參閱在 design.css 檔案中定義樣式。
assets/render.js
此檔案指定 layout.html
中使用的資料,並且可讓您新增內容版面配置的動態行為。請參閱定義 RequireJS 模組。
如果您建立允許使用自訂設定值的版面配置 (在建立版面配置時使用 -a
選項),系統還會另外建立一個 settings.html
檔案,用於提供單一內容項目的預設呈現,以顯示該內容項目。