Skip to content

Instantly share code, notes, and snippets.

@dimaip
Last active January 18, 2018 10:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dimaip/5b28e53195f0168137881ce446773072 to your computer and use it in GitHub Desktop.
Save dimaip/5b28e53195f0168137881ce446773072 to your computer and use it in GitHub Desktop.
Recursive rendering of menus with Fusion
prototype(Flowpack.FusionBP:RecursiveMenu) < prototype(Neos.Fusion:Array) {
@process.tmpl = ${'<li>' + value + '</li>'}
title = ${node.properties.title || '<em>' + node.name + '</em>'}
nextLevel = Neos.Fusion:Collection {
@process.tmpl = ${'<ul>' + value + '</ul>'}
@process.tmpl.@if.notEmpty = ${q(node).children().count() > 0}
collection = ${q(node).children().get()}
itemName = 'node'
itemRenderer = Flowpack.FusionBP:RecursiveMenu
}
}
root = Flowpack.FusionBP:RecursiveMenu {
@context.node = ${site}
@process.wrap = ${'<ul>' + value + '</ul>'}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment