Content Components

A common setup for Plenti sites is to use a content-driven component approach. This enables changes that are made in the JSON content source to inform the component display on the frontend of the website. Ultimately this allows content editors to make changes in the CMS to add/remove or reorder components on the page without having to edit any HTML code. It also allows the designer/developer who created the site to enforce a style guide that is more rigid than unstructured WYSIWYG while still allowing more flexibility than a predefined template.

Creating new component content

Component defaults are defined in a similar manner to content type defaults, however they must go in a special named folded called _components inside your top level content folder (e.g. content/_components/grid/_defaults.json). Components do not get their own pages/endpoints, they only exist within the context of being placed on a particular page. In order to do this, you need a content type (or another component) with a _schema.json file that specifies a component widget for one of its fields:

{
  "myfield": {
    "type": "component",
    "options": [
      "hero",
      "grid",
      "slider"
    ]
  }
}

Nested Components

Components are global in nature so they all sit at the same level in the _components folder, but can reference each other. There is no limit to how many levels deep you can nest, but the editing experience could get clunky and performance might degrade if you push this too far.