Inhaltslayout mit Developer Cloud Service erstellen

Sie können ein Inhaltslayout für einen Inhaltstyp in einem Developer Cloud Service-Projekt mit dem Befehl cec create-contentlayout erstellen.

So erstellen Sie ein Inhaltslayout in einem Developer Cloud Service-Projekt:

  1. Gehen Sie in einem Terminalfenster zum Verzeichnis cec-components.

  2. Geben Sie cec create-contentlayout ein, um Optionen und Beispiele für den Befehl anzuzeigen:

    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. Geben Sie den folgenden Befehl ein, um herauszufinden, welche Inhaltstypen auf Ihrem Server verfügbar sind:

    cec list-server-content-types
  4. Wie in der Verwendung gezeigt, können Sie ein Inhaltslayout für den Inhaltstyp im Oracle Content Management-Server oder für den Inhaltstyp in den Vorlagen unter cec-components/src/main/templates erstellen. Beispiel: Mit dem folgenden Befehl erstellen Sie das Inhaltslayout für den Typ im Server:

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

Sie können das Inhaltslayout ändern, indem Sie die folgenden Dateien bearbeiten:

Wenn Sie ein Layout erstellt haben, das benutzerdefinierte Einstellungen zulässt (durch Verwenden der Option -a beim Erstellen des Layouts), wird eine zusätzliche Datei namens settings.html erstellt. Diese stellt ein Standardrendering eines einzelnen Inhaltselements bereit, damit dieses angezeigt werden kann.