AFX Loop item.node property

Hi guys,

I need your help once again (Sorry, but I’m not a fan of the documentation).

I want to render a submenu, but only if the node-property (declared in yaml-file) hasSubMenu is true.

<Neos.Fusion:Loop items={props.menuItems}>
    <li class={(item.state + " li__level--one" + (item.subItems && " hasSub" : ""))}>
        <Neos.Neos:NodeLink node={item.node} @if.hasSubMenu={!} attributes.class="navLink">
        <span class="navLink openSub" @if.hasSubMenu={}>{item.label}</span>
        <div class="nav__level--two__container" @if.hasSubMenu={}>
            <ul class="nav__level---two">

Is there any possibilty to get the node-property hasSubMenu from the items?

This would also be great to display the meta-description (or any other custom properties) in the submenu.

Thanks in advance :slight_smile:

Best guess (disclaimer: I don’t do much Neos CMS work) would give you the value of the property"hasSubMenu".

Similar, you have access to all other properties such as meta data properties etc for you to use as you like

1 Like

Use q(item.node).property('hasSubMenu')

The item.node thing is actually in the docs on :wink:

1 Like

Thanks, both solutions work perfectly.

  • q(item.node).property('hasSubMenu')

The .property method is faster as it only loads value, where properties loads all and then selects one