Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Manual rendering of page menus and different treatment for specific page uids
<div xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:section name="MainMenu">
<ul class="nav">
<v:page.menu pageUid="{settings.mainMenuRootPageUid}" entryLevel="2" levels="2" expandAll="TRUE" as="menu">
<f:for each="{menu}" as="item">
<v:switch value="{item.uid}">
<v:case case="{settings.pageUidToDoSmthElse}" break="TRUE">
<li class="{item.class} dropdown">
<a href="{item.link}" class="dropdown-toggle" data-toggle="dropdown">{item.linktext}</a>
<f:render partial="PageMenu/OtherTypeOfSubmenu" arguments="{_all}" optional="TRUE" />
</li>
</v:case>
<v:case case="default">
<f:if condition="{item.hasSubPages}">
<f:then>
<li class="{item.class} dropdown">
<a href="{item.link}" class="dropdown-toggle" data-toggle="dropdown">{item.linktext}</a>
<ul class="dropdown-menu">
<f:render section="Submenu" arguments="{_all}" />
</ul>
</li>
</f:then>
<f:else>
<li class="{item.class}">
<a href="{item.link}">{item.linktext}</a>
</li>
</f:else>
</f:if>
</v:case>
</v:switch>
</f:for>
</v:page.menu>
</ul>
</f:section>
<f:section name="Submenu">
<v:page.menu pageUid="{item.uid}" entryLevel="2" levels="1" as="submenu">
<f:for each="{submenu}" as="subitem">
<li class="{subitem.class}">
<a href="{subitem.link}">{subitem.linktext}</a>
</li>
</f:for>
</v:page.menu>
</f:section>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.