Skip to content

Instantly share code, notes, and snippets.

@theilm
Forked from dimaip/gist:d89ff6c5f3b656207f9d
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theilm/07a23a7ffe2b9e091ce9 to your computer and use it in GitHub Desktop.
Save theilm/07a23a7ffe2b9e091ce9 to your computer and use it in GitHub Desktop.
# Set document node title on creation
'TYPO3.Neos:Document':
options:
actionsOnNodeCreation:
'setDocumentTitle':
type: 'setNodeProperties'
options:
properties:
'title': '${data.title}'
enabled: '${true}' # Possibility to bypass action based on some conditions
ui:
wizard:
properties:
'title':
type: 'string'
ui:
label: 'Title'
# Auto create columns based on node count input
'My.Grid:Row':
options:
actionsOnNodeCreation:
'createGridColumns':
type: 'createNodes'
options:
nodePath: 'main' # Defaults to direct child of current node when unset
nodeAmount: '${data.nodeCount}' # defaults to one
nodeData:
nodeType: 'My.Grid:Column'
properties:
'className': "${'column-' + 12 / data.nodeCount}"
ui:
label: 'Grid Row'
wizard:
type: 'DefaultWizard' # Possible to replace by completely custom implementation of wizard in a fully quealified format
ui:
groups:
'main':
label: 'Main'
properties:
'nodeCount':
type: 'string'
ui:
label: 'Node count'
# Rethink AssetList, create Asset nodes based on selected assets
'TYPO3.Neos.NodeTypes:AssetList':
options:
actionsOnNodeCreation:
'createImageNodesForGallery':
type: 'createNodesFromArray'
options:
nodeData:
nodeType: 'TYPO3.Neos.NodeTypes:Asset'
dynamicProperty: 'asset'
dynamicPropertySource: '${data.assets}'
ui:
wizard:
'assets':
type: array<TYPO3\Media\Domain\Model\Asset>
ui:
label: 'Assets'
# Create customised dummy teaser Text node, based on category of parent node
'My.News:Article':
options:
actionsOnNodeCreation:
'createDefaultTeaser':
type: 'createNodes'
options:
nodePath: 'teaser'
nodeData:
nodeType: 'TYPO3.Neos.NodeTypes:Text'
properties:
'text': "${'This is a dummy text for a ' + q(node).property('category') + ' article'}" # node, documentNode and data (wizard form values) are available as context variables
# Custom action on node creation: create a nested predefined structure of nodes
'My.Package:Tabs':
options:
actionsOnNodeCreation:
'fillInWithDummyContent':
type: '\My\Package\ActionsOnNodeCreation\CreateNodesFromStructure'
options:
nodeStructure:
- nodeType: 'My.Package:TabItem'
properties:
title: 'Tab 1'
activeTab: TRUE
children:
- nodeType: 'TYPO3.Neos.NodeTypes:Text'
properties:
text: '<h4>Tab panel 1</h4><p>This is a sample tab 1 content.</p>'
- nodeType: 'My.Package:TabItem'
properties:
title: 'Tab 2'
children:
- nodeType: 'TYPO3.Neos.NodeTypes:Text'
properties:
text: '<h4>Tab panel 2</h4><p>This is a sample tab 2 content.</p>'
- nodeType: 'My.Package:TabItem'
properties:
title: 'Tab 3'
children:
- nodeType: 'TYPO3.Neos.NodeTypes:Text'
properties:
text: '<h4>Tab panel 3</h4><p>This is a sample tab 3 content.</p>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment