vhs
vhs copied to clipboard
was "classHasSubpages" removed from v:menu on version 7.*
I always used classHasSubpages on v:menu to generate a class for the parent page, if a subpages exist.
now in vhs 7.0.* I get this Exception error:
Undeclared arguments passed to ViewHelper FluidTYPO3\Vhs\ViewHelpers\MenuViewHelper: classHasSubpages
typo3. 12.4.13 (composer vhs 7.0.2
my menu setup: <v:menu pageUid="1" excludePages="" tagName="ul" tagNameChildren="li" levels="4" expandAll="1" classFirst="first" classLast="last" classActive="active" classCurrent="current" classHasSubpages="sub" showHiddenInMenu="0" titleFields="subtitle,nav_title,title" includeSpacers="0" as="root" forceAbsoluteUrl="0">
-
.......
full error prompt: Undeclared arguments passed to ViewHelper FluidTYPO3\Vhs\ViewHelpers\MenuViewHelper: classHasSubpages. Valid arguments are: additionalAttributes, data, aria, class, dir, id, lang, style, title, accesskey, tabindex, onclick, forceClosingTag, hideIfEmpty, contenteditable, contextmenu, draggable, dropzone, translate, spellcheck, hidden, showAccessProtected, classAccessProtected, classAccessGranted, useShortcutUid, useShortcutTarget, useShortcutData, tagName, tagNameChildren, entryLevel, levels, expandAll, classFirst, classLast, classActive, classCurrent, substElementUid, showHiddenInMenu, showCurrent, linkCurrent, linkActive, titleFields, includeAnchorTitle, includeSpacers, deferred, as, rootLineAs, excludePages, forceAbsoluteUrl, doktypes, divider, pageUid, in file .......
All the other attributes from https://docs.typo3.org/p/fluidtypo3/vhs/7.0/en-us/ViewHelpers/Page/Menu.html?highlight=classhassubpages are shown - but where has classHasSubpages gone ?
Same here. The attribute no longer exists in the documentation . But I don't know how to migrate this. Could anybody give me a hint please.
Yes, this attribute was removed in version 7.0. If you need this type of functionality you can use f:if to check {item.hasSubPages} in the loop that renders your menu. For example:
<v:menu ... as="menu">
<f:for each="{menu}" as="item">
<a href="{item.link}" class="menu-item{f:if(condition: item.hasSubPages, then: ' with-sub-pages')}">{item.text}</a>
</f:for>
</v:menu>