Tool Bar
Webriq logo
Notifications

Admin Panel

Configure Content Model

Add a config.yml file to /admin folder.


              MyWebsite/
              |--admin/
              |  |--config.yml
              |  |--index.jade
              |
              |--data/
              |  |--general.json
              |
              |--posts/
              |  |--blog.md
              |
              |--views/
              |  |--index.jade
              |  |--layout.jade
              |

            

WebriQ CMS works with the concept of collections of documents that a user can edit.

Collections basically comes in two forms:

  1. A folder. Set the folder attribute on the collection. Each document will be a file in this folder. Each document will have the same format, fields and meta fields.
  2. A list of files. Set the files attribute on the collection. You can set fields that all files in the folder shares directly on the collection, and set specific fields for each file. This is great when you have files with a different structure.

Each collection has a list of fields (or files with their individual fields). Each field has a label, a name and a widget.

Setting up the right collections is the main part of integrating netlify CMS with your site. It's where you decide exactly what content editors can work with, and what widgets should be used to edit each field of your various files or content types.



  backend:
  name: github-api
  repo: owner/repo # Path to your Github repository
  branch: master # Branch to update (master by default)

  media_folder: "img/uploads" # Folder where user uploaded files should go

  collections: # A list of collections the CMS should be able to edit
    - name: "post" # Used in routes, ie.: /admin/collections/:slug/edit
      label: "Post" # Used in the UI, ie.: "New Post"
      folder: "posts" # The path to the folder where the documents are stored
      create: true # Allow users to create new documents in this collection
      fields: # The fields each document in this collection have
        - {label: "Title", name: "title", widget: "string", tagname: "h1"}
        - {label: "Body", name: "body", widget: "markdown"}
        - {label: "Foo", name: "foo", widget: "foo"}
      meta: # Meta data fields. Just like fields, but without any preview element
        - {label: "Publish Date", name: "date", widget: "datetime"}

    - name: "settings"
      label: "Settings"
      files:
        - name: "general"
          label: "General settings"
          file: "_settings/general.json"
          fields:
            - {label: "Main site title", name: "site_title", widget: "string"}
            - {label: "Number of fronpage posts", name: "post_count", widget: "number"}
            - {label: "Site cover image", name: "cover", widget: "image"}
            

Roots Collection Content Model


  - name: "post" # Used in routes, ie.: /admin/collections/:slug/edit
      label: "Post" # Used in the UI, ie.: "New Post"
      folder: "posts" # The path to the folder where the documents are stored
      create: true # Allow users to create new documents in this collection
      fields: # The fields each document in this collection have
        - {label: "Title", name: "title", widget: "string", tagname: "h1"}
        - {label: "Body", name: "body", widget: "markdown"}
        - {label: "Foo", name: "foo", widget: "foo"}
      meta: # Meta data fields. Just like fields, but without any preview element
        - {label: "Publish Date", name: "date", widget: "datetime"}

On app.coffee add this following lines on extensions[]

Example:

  
    extensions: [ collections(folder: '_posts', layout: 'post')]
  

Roots Records Content Model


  - name: "settings"
    label: "Settings"
    files:
      - name: "general"
        label: "General settings"
        file: "_settings/general.json"
        fields:
          - {label: "Main site title", name: "site_title", widget: "string"}
          - {label: "Number of fronpage posts", name: "post_count", widget: "number"}
          - {label: "Site cover image", name: "cover", widget: "image"}

On app.coffee add this following lines on extensions[]

Example:

  
    extensions: [ records(
      general: { file: "data/general.json"}
    )]