Bug #52928

Content elements with hidden header are hidden in section index

Added by Marc Bastian Heinrichs about 6 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2013-10-17
Due date:
% Done:

100%

TYPO3 Version:
4.7
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Just noticed a behaviour change with 4.7, that could be ugly, when updating from 4.5 to 6.2. It was introduced with accessible content rendering #31767.

Before 4.7 you could build up a section index with links to elements with a hidden header. With the implementation in 4.7 you could not reenable this tricky, but well known, behaviour.
Since 4.7 elements with a hidden header are sorted out in the section index, what IMO doesn't make sense, because you have the extra flag "sectionIndex" for content elements to do this.

Changing/fixing this for 4.7 to 6.2 again would not be nice, but perhaps a additional flag like includeNotInMenu for menus could be a solution, if we call it a task and not a feature.

Associated revisions

Revision d222e935 (diff)
Added by Marc Bastian Heinrichs over 5 years ago

[TASK] Make section index from hidden headers work again

Before version 4.7 you could build up a section index with
links to content elements with hidden headers.
Since version 4.7 elements with a hidden header type are sorted
out for the section index, overriding the extra flag "sectionIndex",
which is especially integrated for this.

This patch adds a extra flag for menu configuration sectionIndex
named "includeHiddenHeaders" to make it possible to re-enable
the behaviour of versions before 4.7.

Resolves: #52928
Related: #31767
Documentation: #53699
Releases: 6.2
Change-Id: Iee7f20cfc317c2b624dfc440811c5edc0a367a1e
Reviewed-on: https://review.typo3.org/24876
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Sebastian Fischer
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Gerrit Code Review about 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24876

#2 Updated by Patrick Broens almost 6 years ago

Are you sure this happened in 4.7? When comparing the code of 4.5 and 4.7 I only see refactoring, but not the actual change.

In 4.5
typo3/sysext/cms/tslib/class.tslib_menu.php

case 'header':
$selectSetup['andWhere'] .= ' AND header_layout!=100 AND header!=""';
break;

in 4.7
typo3/sysext/cms/tslib/class.tslib_menu.php

$isValidHeader = (intval($row['header_layout']) !== 100 && trim($row['header']) !== '');

Both are filtering out the hidden headers. As I can see nothing has been changed. When looking at the TSREF documents from 4.3 uuntil now the following is mentioned:

If this property is "header" then only content elements with a visible header-layout (and a non-empty 'header'-field!) is selected. In other words, if the header layout of an element is set to "Hidden" then the page will not appear in the menu.

Could you provide some code for 4.5 to show how it is working there for you? Are you using the parameter sectionIndex?

#3 Updated by Patrick Broens almost 6 years ago

  • Status changed from Under Review to Needs Feedback

#4 Updated by Marc Bastian Heinrichs almost 6 years ago

  • Status changed from Needs Feedback to Under Review

Hey Patrick,

thanks for digging into this.

Yes, I have to be more precise. You are right, the php implementation of menu option sectionIndex doesn't change for this behaviour.

But before 4.7 the menu type 3 (section index of a page) was rendered by typoscript only

3 < styles.content.get
3 {
    wrap = <ul class="csc-menu csc-menu-3">|</ul>
    select.andWhere = sectionIndex!=0
    select.pidInList.override.field = pages
    renderObj = TEXT
    renderObj {
        fieldRequired = header
        trim = 1
        field = header
        htmlSpecialChars = 1
        wrap = <li class="csc-section">|</li>
        typolink.parameter.field = pid
        typolink.section.field = uid
    }
}

In 4.7 this was changed to using sectionIndex like in menu type 7 (subpages to these pages + sections)

3 < .default
3 {
    special {
        value {
            override {
                data = page:uid
                if {
                    isFalse.field = pages
                }
            }
        }
    }
    stdWrap {
        outerWrap = <ul class="csc-menu csc-menu-3">|</ul>
    }
    1 = TMENU
    1 {
        sectionIndex = 1
        sectionIndex.type = header
        NO.wrapItemAndSub = <li class="csc-section">|</li>
    }
}

So in versions lower 4.7 sorting out the elements with header_layout 100 in menu class was not relevant.

#5 Updated by Patrick Broens almost 6 years ago

Now it totally makes sense what you mean. Thanks for the explanation.

#6 Updated by Gerrit Code Review almost 6 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/24876

#7 Updated by Gerrit Code Review over 5 years 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/24876

#8 Updated by Gerrit Code Review over 5 years 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/24876

#9 Updated by Gerrit Code Review over 5 years 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/24876

#10 Updated by Gerrit Code Review over 5 years ago

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

#11 Updated by Gerrit Code Review over 5 years ago

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

#12 Updated by Gerrit Code Review over 5 years ago

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

#13 Updated by Marc Bastian Heinrichs over 5 years ago

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

#14 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF