Fusion Reference
Neos.Fusion
This package contains general-purpose Fusion objects, which are usable both within Neos and standalone.
Neos.Fusion:Array
- [key]:
(string) A nested definition (simple value, expression or object) that evaluates to a string
- [key].@ignoreProperties:
(array) A list of properties to ignore from being “rendered” during evaluation
- [key].@position:
(string/integer) Define the ordering of the nested definition
Note
The Neos.Fusion:Array object has been renamed to Neos.Fusion:Join the old name is DEPRECATED;
Neos.Fusion:Join
Render multiple nested definitions and concatenate the results.
- [key]:
(string) A nested definition (simple value, expression or object) that evaluates to a string
- [key].@ignoreProperties:
(array) A list of properties to ignore from being “rendered” during evaluation
- [key].@position:
(string/integer) Define the ordering of the nested definition
- @glue:
(string) The glue used to join the items together (default = ‘’).
The order in which nested definitions are evaluated are specified using their
@position
meta property. For this argument, the following sort order applies:
start [priority]
positions. The higher the priority, the earlier the object is added. If no priority is given, the element is sorted after allstart
elements with a priority.[numeric ordering]
positions, ordered ascending.end [priority]
positions. The higher the priority, the later the element is added. If no priority is given, the element is sorted before allend
elements with a priority.
Furthermore, you can specify that an element should be inserted before or after a given
other named element, using before
and after
syntax as follows:
before [namedElement] [optionalPriority]
: add this element beforenamedElement
; the higher the priority the more in front ofnamedElement
we will add it if multiplebefore [namedElement]
statements exist. Statements without[optionalPriority]
are added the farthest before the element.If
[namedElement]
does not exist, the element is added after allstart
positions.after [namedElement] [optionalPriority]
: add this element afternamedElement
; the higher the priority the more closely afternamedElement
we will add it if multipleafter [namedElement]
statements exist. Statements without[optionalPriority]
are added farthest after the element.If
[namedElement]
does not exist, the element is added before all allend
positions.
Example Ordering:
# in this example, we would not need to use any @position property;
# as the default (document order) would then be used. However, the
# order (o1 ... o9) is *always* fixed, no matter in which order the
# individual statements are defined.
myString = Neos.Fusion:Join {
o1 = Neos.NodeTypes:Text
o1.@position = 'start 12'
o2 = Neos.NodeTypes:Text
o2.@position = 'start 5'
o2 = Neos.NodeTypes:Text
o2.@position = 'start'
o3 = Neos.NodeTypes:Text
o3.@position = '10'
o4 = Neos.NodeTypes:Text
o4.@position = '20'
o5 = Neos.NodeTypes:Text
o5.@position = 'before o6'
o6 = Neos.NodeTypes:Text
o6.@position = 'end'
o7 = Neos.NodeTypes:Text
o7.@position = 'end 20'
o8 = Neos.NodeTypes:Text
o8.@position = 'end 30'
o9 = Neos.NodeTypes:Text
o9.@position = 'after o8'
}
If no @position
property is defined, the array key is used. However, we suggest
to use @position
and meaningful keys in your application, and not numeric ones.
Example of numeric keys (discouraged):
myString = Neos.Fusion:Join {
10 = Neos.NodeTypes:Text
20 = Neos.NodeTypes:Text
}
Neos.Fusion:Collection
Render each item in collection
using itemRenderer
.
- collection:
(array/Iterable, required) The array or iterable to iterate over
- itemName:
(string, defaults to
item
) Context variable name for each item- itemKey:
(string, defaults to
itemKey
) Context variable name for each item key, when working with array- iterationName:
(string, defaults to
iterator
) A context variable with iteration information will be available under the given name:index
(zero-based),cycle
(1-based),isFirst
,isLast
- itemRenderer:
(string, required) The renderer definition (simple value, expression or object) will be called once for every collection element, and its results will be concatenated (if
itemRenderer
cannot be rendered the pathcontent
is used as fallback for convenience in afx)
Note
The Neos.Fusion:Collection object is DEPRECATED use Neos.Fusion:Loop instead.
Example using an object itemRenderer
:
myCollection = Neos.Fusion:Collection {
collection = ${[1, 2, 3]}
itemName = 'element'
itemRenderer = Neos.Fusion:Template {
templatePath = 'resource://...'
element = ${element}
}
}
Example using an expression itemRenderer
:
myCollection = Neos.Fusion:Collection {
collection = ${[1, 2, 3]}
itemName = 'element'
itemRenderer = ${element * 2}
}
Neos.Fusion:RawCollection
Render each item in collection
using itemRenderer
and return the result as an array (opposed to string for Neos.Fusion:Collection)
- collection:
(array/Iterable, required) The array or iterable to iterate over
- itemName:
(string, defaults to
item
) Context variable name for each item- itemKey:
(string, defaults to
itemKey
) Context variable name for each item key, when working with array- iterationName:
(string, defaults to
iterator
) A context variable with iteration information will be available under the given name:index
(zero-based),cycle
(1-based),isFirst
,isLast
- itemRenderer:
(mixed, required) The renderer definition (simple value, expression or object) will be called once for every collection element (if
itemRenderer
cannot be rendered the pathcontent
is used as fallback for convenience in afx)
Note
The Neos.Fusion:RawCollection object is DEPRECATED use Neos.Fusion:Map instead.**
Neos.Fusion:Loop
Render each item in items
using itemRenderer
.
- items:
(array/Iterable, required) The array or iterable to iterate over
- itemName:
(string, defaults to
item
) Context variable name for each item- itemKey:
(string, defaults to
itemKey
) Context variable name for each item key, when working with array- iterationName:
(string, defaults to
iterator
) A context variable with iteration information will be available under the given name:index
(zero-based),cycle
(1-based),isFirst
,isLast
- itemRenderer:
(string, required) The renderer definition (simple value, expression or object) will be called once for every collection element, and its results will be concatenated (if
itemRenderer
cannot be rendered the pathcontent
is used as fallback for convenience in afx)- @glue:
(string) The glue used to join the items together (default = ‘’).
Example using an object itemRenderer
:
myLoop = Neos.Fusion:Loop {
items = ${[1, 2, 3]}
itemName = 'element'
itemRenderer = Neos.Fusion:Template {
templatePath = 'resource://...'
element = ${element}
}
}
Example using an expression itemRenderer
:
myLoop = Neos.Fusion:Loop {
items = ${[1, 2, 3]}
itemName = 'element'
itemRenderer = ${element * 2}
}
Neos.Fusion:Map
Render each item in items
using itemRenderer
and return the result as an array (opposed to string for Neos.Fusion:Collection)
- items:
(array/Iterable, required) The array or iterable to iterate over
- itemName:
(string, defaults to
item
) Context variable name for each item- itemKey:
(string, defaults to
itemKey
) Context variable name for each item key, when working with array- iterationName:
(string, defaults to
iterator
) A context variable with iteration information will be available under the given name:index
(zero-based),cycle
(1-based),isFirst
,isLast
- itemRenderer:
(mixed, required) The renderer definition (simple value, expression or object) will be called once for every collection element to render the item (if
itemRenderer
cannot be rendered the pathcontent
is used as fallback for convenience in afx)- keyRenderer:
(mixed, optional) The renderer definition (simple value, expression or object) will be called once for every collection element to render the key in the result collection.
Neos.Fusion:Reduce
Reduce the given items to a single value by using itemRenderer
.
- items:
(array/Iterable, required) The array or iterable to iterate over
- itemName:
(string, defaults to
item
) Context variable name for each item- itemKey:
(string, defaults to
itemKey
) Context variable name for each item key, when working with array- carryName:
(string, defaults to
carry
) Context variable that contains the result of the last iteration- iterationName:
(string, defaults to
iterator
) A context variable with iteration information will be available under the given name:index
(zero-based),cycle
(1-based),isFirst
,isLast
- itemReducer:
(mixed, required) The reducer definition (simple value, expression or object) that will be applied for every item.
- initialValue:
(mixed, defaults to
null
) The value that is passed to the first iteration or returned if the items are empty
Neos.Fusion:Case
Conditionally evaluate nested definitions.
Evaluates all nested definitions until the first condition
evaluates to TRUE
. The Case object will
evaluate to a result using either renderer
, renderPath
or type
on the matching definition.
- [key]:
A matcher definition
- [key].condition:
(boolean, required) A simple value, expression or object that will be used as a condition for this matcher
- [key].type:
(string) Object type to render (as string)
- [key].element.*:
(mixed) Properties for the rendered object (when using
type
)- [key].renderPath:
(string) Relative or absolute path to render, overrules
type
- [key].renderer:
(mixed) Rendering definition (simple value, expression or object), overrules
renderPath
andtype
- [key].@position:
(string/integer) Define the ordering of the nested definition
Simple Example:
myCase = Neos.Fusion:Case {
someCondition {
condition = ${q(node).is('[instanceof MyNamespace:My.Special.SuperType]')}
type = 'MyNamespace:My.Special.Type'
}
otherCondition {
@position = 'start'
condition = ${q(documentNode).property('layout') == 'special'}
renderer = ${'<marquee>' + q(node).property('content') + '</marquee>'}
}
fallback {
condition = ${true}
renderPath = '/myPath'
}
}
The ordering of matcher definitions can be specified with the @position
property (see Neos.Fusion:Array).
Thus, the priority of existing matchers (e.g. the default Neos document rendering) can be changed by setting or
overriding the @position
property.
Note
The internal Neos.Fusion:Matcher
object type is used to evaluate the matcher definitions which
is based on the Neos.Fusion:Renderer
.
Neos.Fusion:Renderer
The Renderer object will evaluate to a result using either renderer
, renderPath
or type
from the configuration.
- type:
(string) Object type to render (as string)
- element.*:
(mixed) Properties for the rendered object (when using
type
)- renderPath:
(string) Relative or absolute path to render, overrules
type
- renderer:
(mixed) Rendering definition (simple value, expression or object), overrules
renderPath
andtype
Simple Example:
myCase = Neos.Fusion:Renderer {
type = 'Neos.Fusion:Value'
element.value = 'hello World'
}
Note
This is especially handy if the prototype that should be rendered is determined via eel or passed via @context.
Neos.Fusion:Debug
Shows the result of Fusion Expressions directly.
- title:
(optional) Title for the debug output
- plaintext:
(boolean) If set true, the result will be shown as plaintext
- [key]:
(mixed) A nested definition (simple value, expression or object),
[key]
will be used as key for the resulting output
Example:
valueToDebug = "hello neos world"
valueToDebug.@process.debug = Neos.Fusion:Debug {
title = 'Debug of hello world'
# Additional values for debugging
documentTitle = ${q(documentNode).property('title')}
documentPath = ${documentNode.path}
}
# the initial value is not changed, so you can define the Debug prototype anywhere in your Fusion code
Neos.Fusion:DebugConsole
Wraps the given value with a script tag to print it to the browser console. When used as process the script tag is appended to the processed value.
- title:
(optional) Title for the debug output
- value:
(mixed) The value to print to the console
- method:
(string, optional) The method to call on the browser console object
- [key]:
(mixed) Other arguments to pass to the console method
Example:
renderer.@process.debug = Neos.Fusion:Debug.Console {
title = 'My props'
value = ${props}
method = 'table'
}
Multiple values:
renderer.@process.debug = Neos.Fusion:Debug.Console {
value = ${props.foo}
otherValue = ${props.other}
thirdValue = ${props.third}
}
Color usage:
renderer.@process.debug = Neos.Fusion:Debug.Console {
value = ${'%c' + node.identifier}
color = 'color: red'
}
Neos.Fusion:Component
Create a component that adds all properties to the props context and afterward evaluates the renderer.
- renderer:
(mixed, required) The value which gets rendered
Example:
prototype(Vendor.Site:Component) < prototype(Neos.Fusion:Component) {
title = 'Hello World'
titleTagName = 'h1'
description = 'Description of the Neos World'
bold = false
renderer = Neos.Fusion:Tag {
attributes.class = Neos.Fusion:DataStructure {
component = 'component'
bold = ${props.bold ? 'component--bold' : false}
}
content = Neos.Fusion:Join {
headline = Neos.Fusion:Tag {
tagName = ${props.titleTagName}
content = ${props.title}
}
description = Neos.Fusion:Tag {
content = ${props.description}
}
}
}
}
Neos.Fusion:Fragment
A fragment is a component that renders the given content without additional markup. That way conditions can be defined for bigger chunks of afx instead of single tags.
- content:
(string) The value which gets rendered
Example:
renderer = afx`
<Neos.Fusion:Fragment @if.isEnabled={props.enable}>
<h1>Example</h1>
<h2>Content</h2>
</Neos.Fusion:Fragment>
`
Neos.Fusion:Augmenter
Modify given html content and add attributes. The augmenter can be used as processor or as a standalone prototype
- content:
(string) The content that shall be augmented
- fallbackTagName:
(string, defaults to
div
) If no single tag that can be augmented is found the content is wrapped into the fallback-tag before augmentation- [key]:
All other fusion properties are added to the html content as html attributes
Example as a standalone augmenter:
augmentedContent = Neos.Fusion:Augmenter {
content = Neos.Fusion:Join {
title = Neos.Fusion:Tag {
@if.hasContent = ${this.content}
tagName = 'h2'
content = ${q(node).property('title')}
}
text = Neos.Fusion:Tag {
@if.hasContent = ${this.content}
tagName = 'p'
content = ${q(node).property('text')}
}
}
fallbackTagName = 'header'
class = 'header'
data-foo = 'bar'
}
Example as a processor augmenter:
augmentedContent = Neos.Fusion:Tag {
tagName = 'h2'
content = 'Hello World'
@process.augment = Neos.Fusion:Augmenter {
class = 'header'
data-foo = 'bar'
}
}
Neos.Fusion:Template
Render a Fluid template specified by templatePath
.
- templatePath:
(string, required) Path and filename for the template to be rendered, often a
resource://
URI- partialRootPath:
(string) Path where partials are found on the file system
- layoutRootPath:
(string) Path where layouts are found on the file system
- sectionName:
(string) The Fluid
<f:section>
to be rendered, if given- [key]:
(mixed) All remaining properties are directly passed into the Fluid template as template variables
Example:
myTemplate = Neos.Fusion:Template {
templatePath = 'resource://My.Package/Private/Templates/FusionObjects/MyTemplate.html'
someDataAvailableInsideFluid = 'my data'
}
<div class="hero">
{someDataAvailableInsideFluid}
</div>
Neos.Fusion:Value
Evaluate any value as a Fusion object
- value:
(mixed, required) The value to evaluate
Example:
myValue = Neos.Fusion:Value {
value = 'Hello World'
}
Note
Most of the time this can be simplified by directly assigning the value instead of using the Value
object.
Neos.Fusion:Match
Matches the given subject to a value
- @subject:
(string, required) The subject to match
- @default:
(mixed) The default to return when no match was found
- [key]:
(mixed) Definition list, the keys will be matched to the subject and their value returned.
Example:
myValue = Neos.Fusion:Match {
@subject = 'hello'
@default = 'World?'
hello = 'Hello World'
bye = 'Goodbye world'
}
Note
This can be used to simplify many usages of Neos.Fusion:Case when the subject is a string.
Neos.Fusion:Memo
Returns the result of previous calls with the same “discriminator”
- discriminator:
(string, required) Cache identifier
- value:
(mixed) The value to evaluate and store for future calls during rendering
Example:
prototype(My.Vendor:Expensive.Calculation) < prototype(Neos.Fusion:Memo) {
discriminator = 'expensive-calculation'
value = ${1+2}
}
Neos.Fusion:RawArray
Evaluate nested definitions as an array (opposed to string for Neos.Fusion:Array)
- [key]:
(mixed) A nested definition (simple value, expression or object),
[key]
will be used for the resulting array key- [key].@position:
(string/integer) Define the ordering of the nested definition
Tip
For simple cases an expression with an array literal ${[1, 2, 3]}
might be easier to read
Note
The Neos.Fusion:RawArray object has been renamed to Neos.Fusion:DataStructure the old name is DEPRECATED;
Neos.Fusion:DataStructure
Evaluate nested definitions as an array (opposed to string for Neos.Fusion:Array)
- [key]:
(mixed) A nested definition (simple value, expression or object),
[key]
will be used for the resulting array key- [key].@position:
(string/integer) Define the ordering of the nested definition
Tip
For simple cases an expression with an array literal ${[1, 2, 3]}
might be easier to read
Neos.Fusion:Tag
Render an HTML tag with attributes and optional body
- tagName:
(string) Tag name of the HTML element, defaults to
div
- omitClosingTag:
(boolean) Whether to render the element
content
and the closing tag, defaults toFALSE
- selfClosingTag:
(boolean) Whether the tag is a self-closing tag with no closing tag. Will be resolved from
tagName
by default, so default HTML tags are treated correctly.- content:
(string) The inner content of the element, will only be rendered if the tag is not self-closing and the closing tag is not omitted
- attributes:
(iterable) Tag attributes as key-value pairs. Default is
Neos.Fusion:DataStructure
. If a non iterable is returned the value is casted to string.- allowEmptyAttributes:
(boolean) Whether empty attributes (HTML5 syntax) should be used for empty, false or null attribute values. By default this is
true
Example:
htmlTag = Neos.Fusion:Tag {
tagName = 'html'
omitClosingTag = TRUE
attributes {
version = 'HTML+RDFa 1.1'
xmlns = 'http://www.w3.org/1999/xhtml'
}
}
Evaluates to:
<html version="HTML+RDFa 1.1" xmlns="http://www.w3.org/1999/xhtml">
Neos.Fusion:Attributes
A Fusion object to render HTML tag attributes. This object is used by the Neos_Fusion__Tag object to render the attributes of a tag. But it’s also useful standalone to render extensible attributes in a Fluid template.
- [key]:
(string) A single attribute, array values are joined with whitespace. Boolean values will be rendered as an empty or absent attribute.
- @allowEmpty:
(boolean) Whether empty attributes (HTML5 syntax) should be used for empty, false or null attribute values
Note
The Neos.Fusion:Attributes
object is DEPRECATED in favor of a solution inside Neos.Fusion:Tag which takes attributes
as Neos.Fusion:DataStructure
now. If you have to render attributes as string without a tag you can use
Neos.Fusion:Join
with ``@glue` but you will have to concatenate array attributes yourself.
Example:
attributes = Neos.Fusion:Attributes {
foo = 'bar'
class = Neos.Fusion:DataStructure {
class1 = 'class1'
class2 = 'class2'
}
}
Evaluates to:
foo="bar" class="class1 class2"
Unsetting an attribute:
It’s possible to unset an attribute by assigning false
or ${null}
as a value. No attribute will be rendered for
this case.
Neos.Fusion:Http.Message
A prototype based on Neos.Fusion:Array for rendering an HTTP message (response). It should be used to render documents since it generates a full HTTP response and allows to override the HTTP status code and headers.
- httpResponseHead:
(Neos.Fusion:Http.ResponseHead) An HTTP response head with properties to adjust the status and headers, the position in the
Array
defaults to the very beginning- [key]:
(string) A nested definition (see Neos.Fusion:Array)
Example:
// Page extends from Http.Message
//
// prototype(Neos.Neos:Page) < prototype(Neos.Fusion:Http.Message)
//
page = Neos.Neos:Page {
httpResponseHead.headers.Content-Type = 'application/json'
}
Neos.Fusion:Http.ResponseHead
A helper object to render the head of an HTTP response
- statusCode:
(integer) The HTTP status code for the response, defaults to
200
- headers.*:
(string) An HTTP header that should be set on the response, the property name (e.g.
headers.Content-Type
) will be used for the header name
Neos.Fusion:UriBuilder
Built a URI to a controller action
- package:
(string) The package key (e.g.
'My.Package'
)- subpackage:
(string) The subpackage, empty by default
- controller:
(string) The controller name (e.g.
'Registration'
)- action:
(string) The action name (e.g.
'new'
)- arguments:
(array) Arguments to the action by named key
- format:
(string) An optional request format (e.g.
'html'
)- section:
(string) An optional fragment (hash) for the URI
- additionalParams:
(array) Additional URI query parameters by named key
- addQueryString:
(boolean) Whether to keep the query parameters of the current URI
- argumentsToBeExcludedFromQueryString:
(array) Query parameters to exclude for
addQueryString
- absolute:
(boolean) Whether to create an absolute URI
Example:
uri = Neos.Fusion:UriBuilder {
package = 'My.Package'
controller = 'Registration'
action = 'new'
}
Neos.Fusion:ResourceUri
Build a URI to a static or persisted resource
- path:
(string) Path to resource, either a path relative to
Public
andpackage
or aresource://
URI- package:
(string) The package key (e.g.
'My.Package'
)- resource:
(Resource) A
Resource
object instead ofpath
andpackage
- localize:
(boolean) Whether resource localization should be used, defaults to
true
Example:
scriptInclude = Neos.Fusion:Tag {
tagName = 'script'
attributes {
src = Neos.Fusion:ResourceUri {
path = 'resource://My.Package/Public/Scripts/App.js'
}
}
}
Neos.Fusion:CanRender
Check whether a Fusion prototype can be rendered. For being renderable a prototype must exist and have an implementation class, or inherit from an existing renderable prototype. The implementation class can be defined indirectly via base prototypes.
- type:
(string) The prototype name that is checked
Example:
canRender = Neos.Fusion:CanRender {
type = 'My.Package:Prototype'
}
Neos.Neos Fusion Objects
The Fusion objects defined in the Neos package contain all Fusion objects which are needed to integrate a site. Often, it contains generic Fusion objects which do not need a particular node type to work on.
Neos.Neos:Page
Subclass of Neos.Fusion:Http.Message, which is based on Neos.Fusion:Array. Main entry point
into rendering a page; responsible for rendering the <html>
tag and everything inside.
- doctype:
(string) Defaults to
<!DOCTYPE html>
- htmlTag:
(Neos_Fusion__Tag) The opening
<html>
tag- htmlTag.attributes:
(Neos.Fusion:Attributes) Attributes for the
<html>
tag- headTag:
(Neos_Fusion__Tag) The opening
<head>
tag- head:
(Neos.Fusion:Array) HTML markup for the
<head>
tag- head.titleTag:
(Neos_Fusion__Tag) The
<title>
tag- head.javascripts:
(Neos.Fusion:Array) Script includes in the head should go here
- head.stylesheets:
(Neos.Fusion:Array) Link tags for stylesheets in the head should go here
- body.templatePath:
(string) Path to a fluid template for the page body
- bodyTag:
(Neos_Fusion__Tag) The opening
<body>
tag- bodyTag.attributes:
(Neos.Fusion:Attributes) Attributes for the
<body>
tag- body:
(Neos.Fusion:Template) HTML markup for the
<body>
tag- body.javascripts:
(Neos.Fusion:Array) Body footer JavaScript includes
- body.[key]:
(mixed) Body template variables
Examples:
Rendering a simple page:
page = Page
page.body.templatePath = 'resource://My.Package/Private/MyTemplate.html'
// the following line is optional, but recommended for base CSS inclusions etc
page.body.sectionName = 'main'
Rendering content in the body:
Fusion:
page.body {
sectionName = 'body'
content.main = PrimaryContent {
nodePath = 'main'
}
}
Fluid:
<html>
<body>
<f:section name="body">
<div class="container">
{content.main -> f:format.raw()}
</div>
</f:section>
</body>
</html
Including stylesheets from a template section in the head:
page.head.stylesheets.mySite = Neos.Fusion:Template {
templatePath = 'resource://My.Package/Private/MyTemplate.html'
sectionName = 'stylesheets'
}
Adding body attributes with bodyTag.attributes
:
page.bodyTag.attributes.class = 'body-css-class1 body-css-class2'
Neos.Neos:ContentCollection
Render nested content from a ContentCollection
node. Individual nodes are rendered using the
Neos.Neos:ContentCase object.
- nodePath:
(string, required) The relative node path of the
ContentCollection
(e.g.'main'
)- @context.node:
(Node) The content collection node, resolved from
nodePath
by default- tagName:
(string) Tag name for the wrapper element
- attributes:
(Neos.Fusion:Attributes) Tag attributes for the wrapper element
Example:
page.body {
content {
main = Neos.Neos:PrimaryContent {
nodePath = 'main'
}
footer = Neos.Neos:ContentCollection {
nodePath = 'footer'
}
}
}
Neos.Neos:PrimaryContent
Primary content rendering, extends Neos.Fusion:Case. This is a prototype that can be used from packages to extend the default content rendering (e.g. to handle specific document node types).
- nodePath:
(string, required) The relative node path of the
ContentCollection
(e.g.'main'
)- default:
Default matcher that renders a ContentCollection
- [key]:
Additional matchers (see Neos.Fusion:Case)
Example for basic usage:
page.body {
content {
main = Neos.Neos:PrimaryContent {
nodePath = 'main'
}
}
}
Example for custom matcher:
prototype(Neos.Neos:PrimaryContent) {
myArticle {
condition = ${q(node).is('[instanceof My.Site:Article]')}
renderer = My.Site:ArticleRenderer
}
}
Neos.Neos:ContentCase
Render a content node, extends Neos.Fusion:Case. This is a prototype that is used by the default content rendering (Neos.Neos:ContentCollection) and can be extended to add custom matchers.
- default:
Default matcher that renders a prototype of the same name as the node type name
- [key]:
Additional matchers (see Neos.Fusion:Case)
Neos.Neos:Content
Base type to render content nodes, extends Neos.Fusion:Template. This prototype is extended by the
auto-generated Fusion to define prototypes for each node type extending Neos.Neos:Content
.
- templatePath:
(string) The template path and filename, defaults to
'resource://[packageKey]/Private/Templates/NodeTypes/[nodeType].html'
(for auto-generated prototypes)- [key]:
(mixed) Template variables, all node type properties are available by default (for auto-generated prototypes)
- attributes:
(Neos.Fusion:Attributes) Extensible attributes, used in the default templates
Example:
prototype(My.Package:MyContent) < prototype(Neos.Neos:Content) {
templatePath = 'resource://My.Package/Private/Templates/NodeTypes/MyContent.html'
# Auto-generated for all node type properties
# title = ${q(node).property('title')}
}
Neos.Neos:ContentComponent
Base type to render component based content-nodes, extends Neos.Fusion:Component.
- renderer:
(mixed, required) The value which gets rendered
Neos.Neos:Editable
Create an editable tag for a property. In the frontend, only the content of the property gets rendered.
- node:
(node) A node instance that should be used to read the property. Default to ${node}
- property:
(string) The name of the property which should be accessed
- block:
(boolean) Decides if the editable tag should be a block element (div) or an inline element (span). Default to true
Example:
title = Neos.Neos:Editable {
property = 'title'
block = false
}
Neos.Neos:Plugin
Base type to render plugin content nodes or static plugins. A plugin is a Flow controller that can implement arbitrary logic.
- package:
(string, required) The package key (e.g. ‘My.Package’)
- subpackage:
(string) The subpackage, defaults to empty
- controller:
(array) The controller name (e.g. ‘Registration’)
- action:
(string) The action name, defaults to ‘index’
- argumentNamespace:
(string) Namespace for action arguments, will be resolved from node type by default
- [key]:
(mixed) Pass an internal argument to the controller action (access with argument name
__key
)
Example:
prototype(My.Site:Registration) < prototype(Neos.Neos:Plugin) {
package = 'My.Site'
controller = 'Registration'
}
Example with argument passed to controller action:
prototype(My.Site:Registration) < prototype(Neos.Neos:Plugin) {
package = 'My.Site'
controller = 'Registration'
action = 'register'
additionalArgument = 'foo'
}
Get argument in controller action:
public function registerAction()
{
$additionalArgument = $this->request->getInternalArgument('__additionalArgument');
[...]
}
Neos.Neos:NodeUri
Build a URI to a node. Accepts the same arguments as the node link/uri view helpers.
- node:
(string/Node) A node object or a node path (relative or absolute) or empty to resolve the current document node
- format:
(string) An optional request format (e.g.
'html'
)- section:
(string) An optional fragment (hash) for the URI
- additionalParams:
(array) Additional URI query parameters.
- argumentsToBeExcludedFromQueryString:
(array) Query parameters to exclude for
addQueryString
- addQueryString:
(boolean) Whether to keep current query parameters, defaults to
FALSE
- absolute:
(boolean) Whether to create an absolute URI, defaults to
FALSE
- baseNodeName:
(string) Base node context variable name (for relative paths), defaults to
'documentNode'
Example:
nodeLink = Neos.Neos:NodeUri {
node = ${q(node).parent().get(0)}
}
Neos.Neos:NodeLink
Renders an anchor tag pointing to the node given via the argument. Based on Neos.Neos:NodeUri. The link text is the node label, unless overridden.
- *:
All Neos.Neos:NodeUri properties
- attributes:
(Neos.Fusion:Attributes) Link tag attributes
- content:
(string) The label of the link, defaults to
node.label
.
Example:
nodeLink = Neos.Neos:NodeLink {
node = ${q(node).parent().get(0)}
}
Note
By default no title
is generated. By setting attributes.title = ${node.label}
the label is rendered as title.
Neos.Neos:ImageUri
Get a URI to a (thumbnail) image for an asset.
- asset:
(Asset) An asset object (
Image
,ImageInterface
or otherAssetInterface
)- width:
(integer) Desired width of the image
- maximumWidth:
(integer) Desired maximum height of the image
- height:
(integer) Desired height of the image
- maximumHeight:
(integer) Desired maximum width of the image
- allowCropping:
(boolean) Whether the image should be cropped if the given sizes would hurt the aspect ratio, defaults to
FALSE
- allowUpScaling:
(boolean) Whether the resulting image size might exceed the size of the original image, defaults to
FALSE
- async:
(boolean) Return asynchronous image URI in case the requested image does not exist already, defaults to
FALSE
- quality:
(integer) Image quality, from 0 to 100
- format:
(string) Format for the image, jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported
- preset:
(string) Preset used to determine image configuration, if set all other resize attributes will be ignored
Example:
logoUri = Neos.Neos:ImageUri {
asset = ${q(node).property('image')}
width = 100
height = 100
allowCropping = TRUE
allowUpScaling = TRUE
}
Neos.Neos:ImageTag
Render an image tag for an asset.
- *:
All Neos.Neos:ImageUri properties
- attributes:
(Neos.Fusion:Attributes) Image tag attributes
Per default, the attribute loading is set to 'lazy'
. To fetch a resource immediately, you can set attributes.loading
to null
, false
or 'eager'
.
Example:
logoImage = Neos.Neos:ImageTag {
asset = ${q(node).property('image')}
maximumWidth = 400
attributes.alt = 'A company logo'
}
Neos.Neos:ConvertUris
Convert internal node and asset URIs (node://...
or asset://...
) in a string to public URIs and allows for
overriding the target attribute for external links and resource links.
- value:
(string) The string value, defaults to the
value
context variable to work as a processor by default- node:
(Node) The current node as a reference, defaults to the
node
context variable- externalLinkTarget:
(string) Override the target attribute for external links, defaults to
_blank
. Can be disabled with an empty value.- resourceLinkTarget:
(string) Override the target attribute for resource links, defaults to
_blank
. Can be disabled with an empty value.- forceConversion:
(boolean) Whether to convert URIs in a non-live workspace, defaults to
FALSE
- absolute:
(boolean) Can be used to convert node URIs to absolute links, defaults to
FALSE
- setNoOpener:
(boolean) Sets the rel=”noopener” attribute to external links, which is good practice, defaults to
TRUE
- setExternal:
(boolean) Sets the rel=”external” attribute to external links. Defaults to
TRUE
Example:
prototype(My.Site:Special.Type) {
title.@process.convertUris = Neos.Neos:ConvertUris
}
Neos.Neos:ContentElementWrapping
Processor to augment rendered HTML code with node metadata that allows the Neos UI to select the node and show
node properties in the inspector. This is especially useful if your renderer prototype is not derived from Neos.Neos:Content
.
The processor expects being applied on HTML code with a single container tag that is augmented.
- node:
(Node) The node of the content element. Optional, will use the Fusion context variable
node
by default.
Example:
prototype(Vendor.Site:ExampleContent) {
value = '<div>Example</div>'
# The following line must not be removed as it adds required meta data
# to edit content elements in the backend
@process.contentElementWrapping = Neos.Neos:ContentElementWrapping {
@position = 'end'
}
}
Neos.Neos:ContentElementEditable
Processor to augment an HTML tag with metadata for inline editing to make a rendered representation of a property editable.
The processor expects beeing applied to an HTML tag with the content of the edited property.
- node:
(Node) The node of the content element. Optional, will use the Fusion context variable
node
by default.- property:
(string) Node property that should be editable
Example:
renderer = Neos.Fusion:Tag {
tagName = 'h1'
content = ${q(node).property('title')}
@process.contentElementEditableWrapping = Neos.Neos:ContentElementEditable {
property = 'title'
}
}