Bug #85138

Shortcut in menu always is rendered as inactive

Added by Simon Gilli about 2 years ago. Updated 7 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
Start date:
2015-05-20
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

A Shortcut in a menu always is rendered as inactive by HMENU. This especialy is a problem in the case a Shurtcut links to a parent page e.g. having a Shortcut `Home` to the parent root page.

The backport to 8 should include a feature toggle to activate this new behavior and not break the current.


Subtasks

Bug #67047: Cannot access shortcut target in menusClosedMathias Brodala


Related issues

Related to TYPO3 Core - Bug #87923: Missing value of item.data.shortcut if use MenuProcessor New 2019-03-15
Related to TYPO3 Core - Bug #69454: Shortcut page ignores the configured url target Closed 2015-09-01
Related to TYPO3 Core - Feature #80841: MenuProcessor is missing an option to mark shorcuts as active or current New 2017-04-13

History

#1 Updated by Riccardo De Contardi about 1 year ago

on Slack Sebastian Klein nicely shared this method, that works if you use Fluid to render your menu, which I report here:

{f:if(condition: '({item.data.doktype} == 4 && {item.data.shortcut} == {data.uid})', then: 'current')}

The item variable name depends on your Fluid template.

#2 Updated by Jan Návrat about 1 year ago

  • Related to Bug #87923: Missing value of item.data.shortcut if use MenuProcessor added

#3 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #69454: Shortcut page ignores the configured url target added

#4 Updated by Benjamin Serfhos about 1 year ago

I created my custom DataProcessor to handle this functionality if you need it;
see: https://gist.github.com/bmoex/b0f8297293930146034838eeab72c087

#5 Updated by Benni Mack about 1 year ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

#6 Updated by Riccardo De Contardi 11 months ago

  • Related to Feature #80841: MenuProcessor is missing an option to mark shorcuts as active or current added

#7 Updated by Vincent Mans 6 months ago

Riccardo De Contardi wrote:

on Slack Sebastian Klein nicely shared this method, that works if you use Fluid to render your menu, which I report here:

[...]

The item variable name depends on your Fluid template.

In order to make that work in cases where the navigation is handled in a section, you may have to add data:data in the arguments list, something like:

<f:render section="MainNavigation" arguments="{menu: mainnavigation, data: data}" />

#8 Updated by Susanne Moog 2 months ago

For menus with pure TypoScript this can be solved by setting alwaysActivePidList conditionally if you are on the root page for example.

#9 Updated by Gerrit Code Review 9 days ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64569

#10 Updated by Gerrit Code Review 9 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64569

#11 Updated by Gerrit Code Review 9 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64569

#12 Updated by Gerrit Code Review 8 days ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64570

#13 Updated by Gerrit Code Review 8 days ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64569

#14 Updated by Gerrit Code Review 8 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64570

#15 Updated by Simon Gilli 7 days ago

  • Target version changed from Candidate for patchlevel to next-patchlevel
  • TYPO3 Version changed from 9 to 10

#16 Updated by Gerrit Code Review 7 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64570

#17 Updated by Gerrit Code Review 7 days ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64569

Also available in: Atom PDF