Layout Manager
Layout enabled Vocab in Drupal:
- Authors
- Sections
- Topics
- Tags
Can have layouts added to individual terms and have a general layout for the vocab.
Layout are also passed down from parent to child, so a layout added to the sport
section will also apply to
sport>football
, unless sport>footall
has its own layout.
Layouts are stored as an array of JSON objects, each object being a row component.
Component Types
The concept of a component type is partially abstract as the definition of what a components is or does is divided
between the CMS and the API.
In the CMS there are 3 categories of components for display purposes:
- Article Components
- Ad Components
- Other Components (default for unassigned components)
Further to this all Article Components MUST be given an article count max, optionally a min count of the number of
articles required for validation.
todo: Consolidate this component logic, this should all be handled in Drupal API in the current structure as the Drupal
API needs to handle adding articles into components.
This is handled in the components constants file:
/src/constants/components.js
This file exports the following constants:
Constant | Purpose |
---|---|
ARTICLE_COMPONENTS | List all components for display as an 'Article Component' |
AD_COMPONENTS | List all components for display as an 'Ad Component' |
ALL_COMPONENTS | combination of the above 2 lists |
ARTICLE_COUNT_MAX | determines how many article slots are rendered for a component |
ARTICLE_COUNT_MIN | changes the component validation to only require a min number of articles rather than max count |
COMPONENT_NAMES | display names for components, this isn't required but makes component names more human friendly |
CHAIN_COMPONENTS | This can likely be deprecated as the chain concept has largely been abandoned by NewsChain |
Article Components
Article Components must have an Article source specified to determine where Articles are added to the component from.
Auto
An auto assigned Article Component doesn't provide any article slots to the user, articles will be added to the component by the API from the section automatically.
Manual
Setting an Article Component to manual automatically creates a new Manual List flagged as a default list (this prevents display in the Manual List section and being able to apply this list to custom)
The purpose of manual is to provide a Manual List instance that is unique to this component (and other components linked with this one) so that the Articles can be managed manually from the layout.
Custom
custom allows the selection of a preexisting Manual List, articles updated/added here will modify that Manual List effecting any other instances in other Layouts.
Manual Lists
Where the Layout of the layout manager handles the structure of the vocab term, except in instances of pinned articles, Manual Lists handle the data that manually curated for these term. Manual Lists are largely implemeneted only on layouts that require alot of manual curation, usually the whole layout will either be 100% auto or 100% manual and custom. Homepages or landing pages are often fully manual.
All of the overridden data is attached to Article instances within the Manual List so that when that Article is moved it is simpler to move the overrides as they are all contained in the Article object.
for more info see Manual Lists.
Preview
The preview is iframe pointed at the frontend specific to the environment of the CMS.
i.e.
indy-cms-dev.brightsites.co.uk
points to indy-web-dev.brightsites.co.uk
the frontend is however placed into preview by flow-core and the application is rehydrated to provide react interaction. see flow-core preview.
Data is passed between the rehydrated frontend and the CMS via postMessage, where each side they are translated
into redux actions.
see preview.