arsors/globalcontent

Letzte Aktivität 02 Nov 2023 2 168
composer require arsors/globalcontent

A NEOS extension package which adds a new page document type. It allows you to create global content and read it everywhere from fusion.

v3.0.0

Homepage
https://github.com/arsors/GlobalContent
Version
v3.0.0
Type
neos-package
Release Date
Nov 02, 2023 15:50
Source
git
Distribution
zip
Requires
MIT
  • #extension
  • #content
  • #global
  • #neos
  • #arsors
  • #globalcontent
f77d27ffb6b7a42362ec903ca72be26d535c7f64

Arsors.GlobalContent

A NEOS extension package which adds a new page document type. It allows you to create global content and read it everywhere from fusion.

Install

Drop composer require arsors/globalcontent in your NEOS Project.

Setup single global content page

  • Create a NodeTypes.GlobalContent.yaml in your site package configuration folder.
  • Fill into NodeTypes.GlobalContent.yaml and adjust:
'Arsors.GlobalContent:GlobalContent':
  ui:
    inspector:
      groups:
        default:
          label: 'General'
          collapsed: true
          icon: 'globe' # Use fontawesome icon titles (without icon- prefix)
        anotherGroup:
          label: 'Another Group'
          collapsed: false
  properties:
    set-a-key:
      type: string
      defaultValue: 'Default Value'
      ui:
        group: 'default' # You can leave out the group (Standard group is 'default')
        inlineEditable: TRUE  
  • Add one Global Content page to your site.

Setup multiple global content pages

For multiple global content pages you have to add and adjust the Settings.yaml of your package. Also you have to add your global content yaml configuration and set your NodeType(s) to the Arsors.GlobalContent:Abstract prototype in fusion.

Follow these steps to achieve multiple global content pages:

  • Add and adjust to your Settings.yaml:
Arsors:
  GlobalContent:
    instanceof:
      - 'Arsors.GlobalContent:GlobalContent'
      - 'Vendor.Packagename:AnotherGlobalContent'
  • Create a NodeTypes.GlobalContent.yaml in your site package configuration folder.
  • Fill into NodeTypes.GlobalContent.yaml and adjust:
'Arsors.GlobalContent:GlobalContent':
  ui:
    inspector:
      groups:
        default:
          label: 'General'
          collapsed: true
          icon: 'globe' # Use fontawesome icon titles (without icon- prefix)
        anotherGroup:
          label: 'Another Group'
          collapsed: false
  properties:
    set-a-key:
      type: string
      defaultValue: 'Default Value'
      ui:
        group: 'default' # You can leave out the group (Standard group is 'default')
        inlineEditable: TRUE

'Vendor.Packagename:AnotherGlobalContent':
  superTypes:
    'Arsors.GlobalContent:Abstract': true
  ui:
    label: 'Form Translation'
    icon: 'file'
  properties:
    set-another-key:
      type: string
      defaultValue: 'Your default value'
      ui:
        inlineEditable: TRUE
  • Add to your fusion file:
prototype(Vendor.Packagename:AnotherGlobalContent) < prototype(Arsors.GlobalContent:Abstract)
  • Add your global content pages to your site.

TIP If you want to deactivate the standard global content NodeType see below.

Read global properties

  • Get the contents by fusion with:
varName = getGlobalContent {
    key = 'your-feld-key'
}

TIP You can also use the shorthand ggc instead of getGlobalContent

Deactivate standard global content NodeType

  • Add 'Arsors.GlobalContent:GlobalContent': ~ in a NodeTypes yaml file
The content of the readme is provided by Github