Crearea unei machete de conţinut cu Developer Cloud Service

Puteţi să creaţi o machetă de conţinut pentru un tip de conţinut în proiectul dvs. Developer Cloud Service cu comanda cec create-contentlayout.

Pentru a crea o machetă de conţinut în proiectul Developer Cloud Service:

  1. Într-o fereastră de terminal, accesaţi directorul cec-components.

  2. Introduceţi cec create-contentlayout pentru a vizualiza opţiuni şi exemple pentru comanda respectivă:

    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. Introduceţi următoarea comandă pentru a vedea ce tipuri de conţinut sunt disponibile pe serverul dvs.:

    cec list-server-content-types
  4. Conform descrierii din "Utilizare", puteţi să creaţi fie o machetă de conţinut pt. tipul de conţinut din serverul Oracle Content Management, fie pt. tipul de conţinut din şabloane sub cec-components/src/main/templates. De exemplu, următoarea comandă creează macheta de conţinut pentru tipul din server:

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

Puteţi să editaţi următoarele fişiere pentru a modifica macheta de conţinut:

Dacă aţi creat o machetă care permite setări personalizate (folosind opţiunea -a la crearea machetei), se creează şi un fişier suplimentar numit settings.html, care asigură o randare prestabilită a unui singur articol de conţinut pentru a putea fi afişat.