2017 © Pedro Peláez
 

neos-package fusionprototypegenerator

Opinionated Fusion prototypes generators

image

codeq/fusionprototypegenerator

Opinionated Fusion prototypes generators

  • Monday, June 25, 2018
  • by rolandschuetz
  • Repository
  • 2 Watchers
  • 0 Stars
  • 86 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 26 % Grown

The README.md

CodeQ.FusionPrototypeGenerator

The default Neos DefaultPrototypeGenerator generates a Fusion prototype definition for a given node type. A node will be rendered by Neos.Neos:Content by default with a template in resource://PACKAGE_KEY/Private/Templates/NodeTypes/NAME.html and forwards all public node properties to the template Fusion object., (*1)

This improved generator uses CodeQ.SimpleTemplate to map the template file path according to current Neos best practises., (*2)

Also, this Fusion prototype generator automatically creates editable properties. propertyName will contain the raw property and propertyNameEditable contains the same property wrapped into Neos editable object., (*3)

To activate these generators, make your base nodetypes to inherit from mixins provided by this package, e.g.:, (*4)

# All nodetypes that want to use new generators should inherit from these ones instead of "Neos.Neos:Content" and "Neos.Neos:Document"
'CodeQ.Site:Content':
  abstract: true
  superTypes:
    'Neos.Neos:Content': true
    'CodeQ.FusionPrototypeGenerator:ContentPrototypeGeneratorMixin': true

'CodeQ.Site:Document':
  abstract: true
  superTypes:
    'Neos.Neos:Document': true
    'CodeQ.FusionPrototypeGenerator:DocumentPrototypeGeneratorMixin': true

Example

Let's say you have a content node type to show a headline:, (*5)

'CodeQ.Site:Content.Headline':
  ...
  properties:
    title:
      type: string
      ui:
        inlineEditable: true
        aloha:
          placeholder: 'Enter headline here...'

The generator will automatically generate on the fly a Fusion prototype like this:, (*6)

prototype(CodeQ.Site:Content.Headline) < prototype(CodeQ.SimpleTemplate:Template) {
    title = ${q(node).property("title")}
    title.@process.convertUris = ConvertUris

    titleEditable = Neos.Fusion:Tag {
        content = ${q(node).property("title")}
        content.@process.convertUris = ConvertUris
        @process.contentElementEditable = ContentElementEditable {
            property = "title"
        }
    }
}

Now create a inline editable Fluid template Resources/Private/Fusion/Content/Headline/Headline.htmlwith the content, (*7)

<div class="headline">
    {titleEditable -> f:format.raw()}
</div>

The Versions

25/06 2018

dev-master

9999999-dev

Opinionated Fusion prototypes generators

  Sources   Download

MIT GPL-3.0+

The Requires

 

flow neos fusion

24/06 2018

v1.0.1

1.0.1.0

Opinionated Fusion prototypes generators

  Sources   Download

MIT

The Requires

 

flow neos fusion

13/01 2018

v1.0.0

1.0.0.0

Opinionated Fusion prototypes generators

  Sources   Download

GPL-3.0+

The Requires