Bug #71044
closedCE Special/Menu Order by ID
Added by M S about 9 years ago. Updated about 6 years ago.
100%
Description
The content element "Special/Menu" renders (fluid_styled_content) the links (sites) by PID. Normaly (6.2 and erlier) TYPO3 uses the same sort as the backend.
Files
Bildschirmfoto 2016-07-28 um 09.12.33.png (24.2 KB) Bildschirmfoto 2016-07-28 um 09.12.33.png | Nando Bosshart, 2016-07-28 09:16 |
Updated by Mathias Schreiber about 9 years ago
- Category set to Fluid Styled Content
- Assignee set to Benni Mack
- Priority changed from Should have to Must have
Updated by Riccardo De Contardi almost 9 years ago
- Target version changed from 7 LTS to Candidate for patchlevel
Updated by Stephan Brun over 8 years ago
The problem can be solved in the Viewhelper (\TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\ListViewHelper).
Sort the $pages array after the getMenuForPages().
Maybe there is a better solution.
Here is my fix:
// get the same sortorder as in the backend $tempPagesForSort = []; foreach ($pageUids as $pageUid) { if($pages[$pageUid]) { $tempPagesForSort[$pageUid] = $pages[$pageUid]; } } $pages = $tempPagesForSort;
Would be nice to have a fix in the core. Thanks.
Updated by Nando Bosshart over 8 years ago
+1 - please fix this in the ViewHelper
Updated by hwt3 no-lastname-given over 8 years ago
+1 This is a must have.
Optimally there should be an option to decide, if to sort via pagetree or order in selection field. At least via ts setting.
Updated by Kai Kretschmann over 8 years ago
Is that patch planned for any upcoming 7.6.10 version?
As it is a real bug (no one sorts intentionally by internal pageID) I hope for a quick solution.
And for the long term I would like to influence the sorting options of those oobjects myself.
Updated by Nando Bosshart over 8 years ago
it's still not fixed in 7.6.10 :-(
the provided patch still works fine with it.
Updated by Robert Wenk over 8 years ago
+1
I agree. Nobody needs sorting by UID.
Please fix it in 7.6.11.
I think, the bug could easy be fixed by adding the default parameter when calling $typoScriptFrontendController->sys_page->getMenuForPages.
At this time an empty string is passed to getMenuForPages, but this is not recognised as empty so the default "sorting" doesn't kick in.
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Menu/ListViewHelper.php
Line 72 to 77 contains
$pages = $typoScriptFrontendController->sys_page->getMenuForPages(
$pageUids,
'*',
Problem --->'',
$this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
);
Fix it by setting the default
$pages = $typoScriptFrontendController->sys_page->getMenuForPages(
$pageUids,
'*',
'sorting',
$this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
);
Updated by Gerrit Code Review over 8 years ago
- Status changed from New 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/49188
Updated by Nando Bosshart over 8 years ago
Robert Wenk: I tested your Patch but it solves not all usage-scenarios with the menu-CE.
If you want to use a "menu with selected pages" you can sort them in the corresponding backend-field - and this sorting needs to be respected as well. Stephans patch (https://forge.typo3.org/issues/71044#note-3) solves this problem
Updated by sas no-lastname-given about 8 years ago
Hi, the problem isn't fixed in 7.6.10 and 7.6.11 like Nando already said. I don't want to edit core files and hope it will be fixed in upcoming 7.6.12!!!
At the moment I try to sort the files/pages with the `vhs`Extension ([[https://fluidtypo3.org/viewhelpers/vhs/1.0.1/Iterator/SortViewHelper.html]])
Type-0.html
<f:comment><!--<f:for each="{pages}" as="page">--></f:comment> <f:for each="{pages->v:iterator.sort(order: 'ASC', sortBy: 'name')}" as="page">
Updated by Gerrit Code Review about 8 years 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/50214
Updated by Gerrit Code Review about 8 years 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/50214
Updated by Joe Jones about 8 years ago
- TYPO3 Version changed from 7 to 8
Gerrit Code Review wrote:
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/50214
Issue also in TYPO3 8.3. The patch of viewhelper works. Please include in next TYPO3 8 release as well. Thank you.
Updated by Anonymous about 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 22b393c53cb6c5e73991bbfd82451f5db8de5143.
Updated by Gerrit Code Review about 8 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50247
Updated by Gerrit Code Review about 8 years ago
Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50247
Updated by Anonymous about 8 years ago
- Status changed from Under Review to Resolved
Applied in changeset 9caa7aab3578ff6f5b7558b20893c37b1b9f62bc.