Project

General

Profile

Actions

Bug #93924

closed

MenuProcessor does not working correctly when doktype folder

Added by Ghanshyam Bhava over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2021-04-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Hi there,

When we have several page under folder, it is not working correctly. I am trying to have several pages under the specific folder storage and fetch those pages with UID with Menuprocessor.

When you change docktype folder to standard page, it works pretty well.

See Menu structure:
Page tree

Code:

70 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
70 {
special = list
special.value = 3
levels = 2
as = footerNavigation
expandAll = 1
includeSpacer = 1
titleField = nav_title // title
}


Files

clipboard-202104142344-xq8a5.png (11.6 KB) clipboard-202104142344-xq8a5.png Page tree Ghanshyam Bhava, 2021-04-14 18:14

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #99198: MenuProcessor returns wrong menuNeeds FeedbackBenjamin Kott2022-11-25

Actions
Actions #1

Updated by Ghanshyam Bhava over 3 years ago

  • Subject changed from Menu with Menuprocessor, handle doktype with creating. to MenuProcessor does not working correctly when doktype folder
Actions #2

Updated by Oliver Bartsch over 3 years ago

  • Status changed from New to Needs Feedback

Hi,

have you tried to use special = directory instead of special = list?

Actions #3

Updated by Ghanshyam Bhava over 3 years ago

Yes, I have checked that but it is returning only sub-pages of given UID.

See:

70 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
70 {
special = list
special.value = 3, 8
levels = 2
as = footerNavigation
expandAll = 1
includeSpacer = 1
titleField = nav_title // title
}

Here I have passed special values 3 and 8 which is UID of storage folder. My expected output should be

Array(
'Footer page' => array('abv') // sub pages of selected folder
'Leftpages' => array('testpage') // subpages of selected folder
)

Actions #4

Updated by Riccardo De Contardi over 3 years ago

Isn't your goal to show the subpages of Footer Page, i.e. a menu with these items:

  • abv
  • fsdsdf
  • theser
  • sdfsdf
  • reytrhytr

?

So special = directory would be ok, am I wrong? Is there something I have not understood?

Actions #5

Updated by Ghanshyam Bhava over 3 years ago

You almost got my point, But I also want the storage folder name. Output should be:

  • Footer page
    • abv
    • fsdsdf
    • theser
    • sdfsdf
    • reytrhytr

I found the solution, As you said we can change `list` to `directory`. Correct code is as below:

70 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
70 {
    special = directory # Change list to directory
    special.value.field = 3, 8 # Add .field to value
    levels = 2
    as = footerNavigation
    expandAll = 1
    includeSpacer = 1
    titleField = nav_title // title
}

This solution works for me :)

Actions #6

Updated by Riccardo De Contardi over 3 years ago

Just for the records, I tried also with special = list and plain TyposScript HMENU and it does not work, too; so the problem is not related to the MenuProcessor. I don't know if the special = list is not supposed to work with sysfolders by default.

Actions #7

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from Needs Feedback to Under Review

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

Actions #8

Updated by Benni Mack almost 3 years ago

Hello everybody,

if the option "excludeDoktypes" is NOT set, it is by default to "Be User Section" and "Folder".

If you use set "excludeDoktypes = 6" then your use-case works.

70 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
70 {
special = list
special.value = 3, 8
levels = 2
as = footerNavigation
expandAll = 1
includeSpacer = 1
# only exclude be user section
excludeDoktypes = 6
titleField = nav_title // title
}

I added tests to document this behaviour

Actions #9

Updated by Gerrit Code Review almost 3 years ago

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

Actions #10

Updated by Gerrit Code Review almost 3 years ago

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

Actions #11

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions #13

Updated by Stefan Bürk almost 2 years ago

  • Related to Bug #99198: MenuProcessor returns wrong menu added
Actions

Also available in: Atom PDF