Bug #93924
closedMenuProcessor does not working correctly when doktype folder
100%
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:
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
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
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
?
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
)
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?
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 :)
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.
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
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
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
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
Updated by Benni Mack almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 107a3f6dab28a07f45a314b75b4b47c9ba7b69f3.
Updated by Stefan Bürk almost 2 years ago
- Related to Bug #99198: MenuProcessor returns wrong menu added