vhs icon indicating copy to clipboard operation
vhs copied to clipboard

was "classHasSubpages" removed from v:menu on version 7.*

Open HorstBaumann opened this issue 1 year ago • 1 comments
trafficstars

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 ?

HorstBaumann avatar Mar 28 '24 14:03 HorstBaumann

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.

max951 avatar May 03 '24 14:05 max951

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>

NamelessCoder avatar Jul 03 '24 11:07 NamelessCoder