flowpack/restrictcreation

Restrict creation of nodes in certain content dimensions

Installs: 22

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 9

Forks: 1

Open Issues: 2

Language:JavaScript

Type:neos-package

0.2 2018-10-23 09:37 UTC

This package is auto-updated.

Last update: 2020-02-02 01:32:57 UTC


README

Imagine the situation: you have a website with 'English (US)', 'English (UK)' and 'German' content dimensions present.

Now you never want editors to create new nodes directly in 'English (UK)', without first creating them in 'English (US)' and almost never in 'German', but some really rare cases.

This package provides an option to enforce these kind of constraints:

restrictcreation

Getting started:

  1. composer require 'flowpack/restrictcreation'
  2. Configure your dimensions in Settings.yaml, e.g. like this:
Neos:
  ContentRepository:
    contentDimensions:
      language:
        presets:
          en_US:
            label: 'English (US)'
            values:
              - en_US
            uriSegment: en
          en_UK:
            label: 'English (UK)'
            values:
              - en_UK
              - en_US
            uriSegment: uk
            restrictCreation:
              mode: disallow
              originPreset: en_US
          de:
            label: German
            values:
              - de
            uriSegment: de
            restrictCreation:
              mode: warn
              originPreset: en_US
              documentNodesOnly: true
  • mode: warn would only give a warning about creating a node in a possible wrong dimensiong.
  • mode: disallow would completely forbid creating new nodes in a certain dimension.
  • documentNodesOnly: true would trigger the warning only for document nodes: you would be able to create content nodes as usual, but creating document nodes in that dimension would be blocked/warned.

Acknowledgments

The initial development of this package is sponsored by web&co.