Last active
January 18, 2018 10:30
-
-
Save dimaip/5b28e53195f0168137881ce446773072 to your computer and use it in GitHub Desktop.
Recursive rendering of menus with Fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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