通过开发人员云服务创建内容布局

可以使用 cec create-contentlayout 命令在开发人员云服务项目中按内容类型创建内容布局。

要在开发人员云服务项目中创建内容布局,请执行以下操作:

  1. 在终端窗口中,转到 cec-components 目录。

  2. 输入 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
  3. 输入以下命令以查看服务器上可用的内容类型:

    cec list-server-content-types
  4. 如 "Usage" 中所示,可以按 Oracle Content Management 服务器中的内容类型创建内容布局,也可以按 cec-components/src/main/templates 下的模板中的内容类型创建内容布局。例如,以下命令按服务器中的类型创建内容布局:

    cec create-contentlayout Blog-Post-Overview-Layout -c Blog-Post -r

可以编辑以下文件来修改内容布局:

如果您创建了一个允许使用定制设置的布局(在创建布局时使用选项 -a),则还将创建一个名为 settings.html 的附加文件,用于提供单个内容项的默认呈现,以便可以显示它。