2017 © Pedro Peláez
 

neos-package outofbandrendering

A package to render Fusion Out of Band in complex application fun & easy

image

ttree/outofbandrendering

A package to render Fusion Out of Band in complex application fun & easy

  • Wednesday, March 29, 2017
  • by ttree
  • Repository
  • 3 Watchers
  • 4 Stars
  • 443 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

Fusion Out of Band rendering helpers

This package provide some helpers to work with Fusion Out of Band rendering in Neos CMS, (*1)

Package under development, API can change at any time, (*2)

How to use ?

Edit your distribution Routes.yaml and add the required routes:, (*3)

-
  name: 'Ttree.OutOfBandRendering'
  uriPattern: '<TtreeOutOfBandRenderingSubroutes>'
  subRoutes:
    'TtreeOutOfBandRenderingSubroutes':
      package: 'Ttree.OutOfBandRendering'
      variables:
        'defaultUriSuffix': ''

With this configuration you can access the URL endpoint at http://www.domain.com/api/v1/rendering., (*4)

Check the Routes.yaml in this package, if you need a custom URL., (*5)

Make it work

The endpoint require two parameters:, (*6)

  • node: the full node path of the rendering node
  • preset: the preset name, check below for information about Presets

You can create preset in two different ways, static presets in Settings.yaml and dynamic presets with your own PHP implementation. A preset is mainly used to limit the Fusion path that can be rendered out of band., (*7)

Static Preset

To use static preset, just write something like this in your Settings.yaml:, (*8)

Ttree:
  OutOfBandRendering:
    presets:
      'marketplace:version':
        path: 'root<Neos.Fusion:Case>/neosMarketPlaceDocument<Neos.Fusion:Matcher>/element<Neos.MarketPlace:Package>/body<Neos.Fusion:Template>/content/main<Neos.Fusion:Array>/package<Neos.MarketPlace:Package>/versions<Neos.MarketPlace:VersionPreview>'

The key marketplace:version is your preset name, and the path the allowed Fusion path to be rendered., (*9)

Dynamic Preset

A dynamic preset is more flexible and allow you to generate the Fusion path dynamically based on the given node., (*10)

You need a PresetDefintion object, the easy way is to extend the AbstractPresetDefinition like this:, (*11)


use Ttree\OutOfBandRendering\Domain\Model\AbstractPresetDefinition; use Neos\ContentRepository\Domain\Model\NodeInterface; class CustomPresetPresetDefinition extends AbstractPresetDefinition { /** * @param NodeInterface $node * @return string */ public function getFusionPath(NodeInterface $node) { return 'page<Ttree.ArchitectesCh:DefaultPage>/body<Neos.Fusion:Template>/content/main<Neos.Neos:PrimaryContent>/enterpriseProfile<Neos.Fusion:Matcher>/element<Ttree.ArchitectesCh:EnterpriseProfile>/reportSection<Ttree.ArchitectesCh:EnterpriseProfileSection>/content<Ttree.ArchitectesCh:ReportMenu>'; } }

The PresetDefinitionInterface force you to defined the following methods:, (*12)

  • PresetDefinitionInterface::getPriority: Return an integer to define the preset priority (higher has more priority, like in the Flow Framework PropertyMapper
  • PresetDefinitionInterface::getName: Return the name of the preset (used in the endpoint URL)
  • PresetDefinitionInterface::canHandle: Receive the current document node as argument, and allow you to add more logic to decide if a preset can handle the given node
  • PresetDefinitionInterface::getFusionPath: Receive the current document node as argument, must return the Fusion path to render

What's next ?

  • Implement authorization support
  • Add JS module to support content loading (appending, replacing, infinite scrolling, ...)

Acknowledgments

Development sponsored by ttree ltd - neos solution provider., (*13)

We try our best to craft this package with a lots of love, we are open to sponsoring, support request, ... just contact us., (*14)

License

Licensed under MIT, see LICENSE, (*15)

The Versions

29/03 2017

dev-master

9999999-dev

A package to render Fusion Out of Band in complex application fun & easy

  Sources   Download

MIT

The Requires

 

neoscms fusion flow-framework

29/03 2017

2.0.0

2.0.0.0

A package to render Fusion Out of Band in complex application fun & easy

  Sources   Download

MIT

The Requires

 

neoscms fusion flow-framework

02/04 2016

1.0.0

1.0.0.0

A package to make TypoScript Out of Band rendering in complex application fun & easy

  Sources   Download

MIT

The Requires

 

typoscript

21/12 2015

0.1.0

0.1.0.0

A package to make TypoScript Out of Band rendering in complex application fun & easy

  Sources   Download

The Requires