#97186Menuprocessor shortcut active subpage wrong link state
Description
It seems that there is a problem with the link state of shortcuts if the shortcut points to a subpage that is currently open in the browser.
We use the MenuProcessor for our breadcrumbs, and if I go to a subpage from a shortcut, and the shortcut links to this specific subpage, then both the shortcut as well as the subpage are getting the status “current”. See attached screenshot.
I would expect that only the current page would get the state “current”, and the parent shortcut page not.
Problem occurs in TYPO3 11.5.8
Reviews 2
Related issues 3
Files 1
History 1315
-
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2022-03-15T14:58:06+00:00" > 03/15/22, 14:58 </span> -
Marcel Macasso commented <span data-processor="relativetime" data-value="2022-03-15T15:17:39+00:00" > 03/15/22, 15:17 </span>
Hi Benni,
sure, this is the TypoScript that is used:
##################### #### BREADCRUMBS #### ##################### page.10.dataProcessing { 40 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor 40 { special = rootline special.range = 0|-1 includeNotInMenu = {$page.navigation.breadcrumbNav.includeNotInMenu} as = navigationBreadcrumb if { value = {$page.navigation.breadcrumbNav.enableLevel} value { insertData = 1 prioriCalc = 1 stdWrap.wrap = |-1 } isGreaterThan { data = level } } } }As a workaround I added in Fluid a check that adds the “current” class only if the page in the iteration has the same uid as the current page I am on.
<f:if condition="{navigation_breadcrumb}"> <nav id="breadcrumbs"> <ol class="breadcrumbs"> <f:for each="{navigation_breadcrumb}" as="item"> <f:variable name="currentCssClass" value="" /> <f:if condition="{item.data.uid} == {pageUid}"> <f:variable name="currentCssClass" value=" current" /> </f:if> <li class="{f:if(condition:item.active, then:' active')}{currentCssClass}"> <f:if condition="{currentCssClass} == false"> <f:then> <span class="name">{item.title}</span> </f:then> <f:else> <a href="{item.link}" title="{item.title}"> <span class="name">{item.title}</span> </a> </f:else> </f:if> </li> </f:for> </ol> </nav> </f:if>But you are right. The question is if a shortcut item could ever have a current state. I guess not.
-
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2022-03-16T14:47:25+00:00" > 03/16/22, 14:47 </span>
is this related? #97037
-
Marcel Macasso changed Related to #97037 <span data-processor="relativetime" data-value="2022-03-29T06:58:38+00:00" > 03/29/22, 06:58 </span>
-
Riccardo De Contardi changed status
Needs FeedbackNew <span data-processor="relativetime" data-value="2022-09-24T14:36:50+00:00" > 09/24/22, 14:36 </span> -
Dmitry Dulepov commented <span data-processor="relativetime" data-value="2022-10-07T12:06:43+00:00" > 10/07/22, 12:06 </span>
Revert a6593bd949 to solve the issue.
-
Christian Welzel commented <span data-processor="relativetime" data-value="2022-11-08T14:43:39+00:00" > 11/08/22, 14:43 </span>
> Let’s use the naming differently: If you have a shortcut item in a menu, could this ever have a “current” status?
No, it should not be active on its own.
If you want the shortcut to be active, you can easily set this by
[page["uid"] == xxx] page.10.dataProcessing.10.alwaysActivePIDlist = yyy [end]This change breaks installations, where the content of the landing page is on the rootpage of the installation and there is a shortcut like “welcome” to this root page in the menu. This “welcome”-page is always active in current TYPO3 versions, no matter, what the real active page is.
-
Christian Hackl commented <span data-processor="relativetime" data-value="2023-04-24T10:29:34+00:00" > 04/24/23, 10:29 </span>
Another workaround:
https://forge.typo3.org/issues/97037 https://forge.typo3.org/issues/97186 ORIGINAL: <f:else if="{item.active}"></f:else> WORKAROUND: <f:else if="{item.active} && {item.data.doktype} !== 4"></f:else> doktype 4 = shortcut page -
Uwe Wiebach commented <span data-processor="relativetime" data-value="2024-05-02T15:53:05+00:00" > 05/02/24, 15:53 </span>
Christian Hackl wrote in #note-8:
> Another workaround:
>
> […]This workaround sadly does not work if the current page is below another shortcut. This one should have the active state but the one leading to the current page not.
So I added this (using EXT:bootstrap_package) to mark only shortcuts not leading to a specific page:
{f:if(condition: '{item.active} && ({item.data.doktype} !== 4 || {item.data.shortcut_mode})', then:' active')} -
Benni Mack changed Related to #99838 <span data-processor="relativetime" data-value="2025-02-19T16:13:47+00:00" > 02/19/25, 16:13 </span>
-
Benni Mack changed Related to #106210 <span data-processor="relativetime" data-value="2025-02-19T16:24:03+00:00" > 02/19/25, 16:24 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 88279 status
NewUnder Review <span data-processor="relativetime" data-value="2025-03-25T12:43:32+00:00" > 03/25/25, 12:43 </span> -
Gerrit Code Review pushed patch set 1 for 13.4 to change 88740 <span data-processor="relativetime" data-value="2025-03-25T12:55:20+00:00" > 03/25/25, 12:55 </span>
-
Oliver Eglseder commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-03-25T13:00:09+00:00" > 03/25/25, 13:00 </span>Applied in changeset commit:09677caddf8dc5151151921d30059cd9c8ae8743.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:33:54+00:00" > 12/02/25, 14:33 </span>
Hey Marcel,
yes, we’ve changed this recently (one could call it a regression, but I guess the current behaviour is more like it should behave in general). Let’s use the naming differently: If you have a shortcut item in a menu, could this ever have a “current” status?
Also, can you share your TypoScript configuration?