Tworzenie układu zawartości za pomocą usługi Developer Cloud Service

Używając polecenia cec create-contentlayout, można w projekcie usługi Developer Cloud Service utworzyć układ zawartości dla typu zawartości.

Aby utworzyć układ zawartości w projekcie Developer Cloud Service, należy:

  1. W oknie terminala przejść do katalogu cec-components.

  2. Wpisać polecenie cec create-contentlayout w celu wyświetlenia opcji i przykładów polecenia:

    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. Aby wyświetlić dostępne typy zawartości na serwerze, wpisać następujące polecenie:

    cec list-server-content-types
  4. Jak pokazano w akapicie "Usage", można utworzyć układ zawartości dla typu zawartości na serwerze Oracle Content Management albo dla typu zawartości z szablonach znajdujących się w folderze cec-components/src/main/templates. Na przykład za pomocą następującego polecenia można utworzyć na serwerze układ zawartości dla danego typu:

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

Aby zmodyfikować układ zawartości, można edytować następujące pliki:

Jeśli zostanie utworzony układ, który zezwala na ustawienia niestandardowe (przy użyciu opcji -a podczas tworzenia układu), zostanie także utworzony dodatkowy plik o nazwie settings.html, udostępniający domyślny sposób renderowania elementu zawartości, dzięki czemu może być on wyświetlany.