Bug #53305

Epic #61834: Create future proof Content Element with strong default

Task #61836: Reorganize Content Element properties within backend Extension

Task #61842: Refactor CSS-Styled-Content + Content Elements

HTML5 rendering of headers works only if a date is set

Added by Wolfgang Wagner almost 6 years ago. Updated almost 4 years ago.

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

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

The HTML5 rendering of a header works only, if I set a date in the content element (see attached screenshot).

I think, the reason is the typoscript of lib.stdheader in CSC:

lib.stdheader {
.
.
.

stdWrap {
        dataWrap = <div class="csc-header csc-header-n{cObj:parentRecordNumber}">|</div>
        dataWrap {
            override = <header class="csc-header csc-header-n{cObj:parentRecordNumber}">|</header>
            override {
                if {
                    isTrue {
                        field = date
                    }
                    value = html5
                    equals.data = TSFE:config|config|doctype
                }
            }
        }
    }

}

Why is there isTrue.field = date?

Version: TYPO3 6.2-dev, latest from Git

2013-11-04_12-17-48.png View (42.2 KB) Wolfgang Wagner, 2013-11-04 12:28


Related issues

Related to TYPO3 Core - Bug #47575: header element is rendered in lib.stdheader for all cases Closed 2013-04-25

History

#1 Updated by Mathias Brodala almost 6 years ago

Wolfgang Wagner wrote:

The HTML5 rendering of a header works only, if I set a date in the content element (see attached screenshot).
Why is there isTrue.field = date?

See issue #47575, grouping a single headline does not make sense, so at least the date needs to be set.

#2 Updated by Oliver Hader almost 6 years ago

  • Complexity set to easy

Thanks for pointing out the date issue which is just a trigger that further information (like the date) is rendered within that header block.
From my perspective, that does not make much sense, but however was to main intention of the referenced change #47575 - so, I'd expect to use HTML5 tags if it is requested.

#3 Updated by Oliver Hader almost 6 years ago

  • Category set to Frontend

#4 Updated by Wolfgang Wagner almost 6 years ago

Mathias Brodala wrote:

See issue #47575, grouping a single headline does not make sense, so at least the date needs to be set.

Grouping is not necessary on a single headline, that's true, but it would be nice if the header-element would be rendered ;)

#5 Updated by Mathias Brodala almost 6 years ago

Wolfgang Wagner wrote:

Grouping is not necessary on a single headline, that's true, but it would be nice if the header-element would be rendered ;)

The decision wrt default behavior is up to the TYPO3 devs, but you can always delete that isTrue condition in you TS if you need to have the <header> element rendered at all time.

#6 Updated by Wolfgang Wagner almost 6 years ago

Mathias Brodala wrote:

The decision wrt default behavior is up to the TYPO3 devs, but you can always delete that isTrue condition in you TS if you need to have the <header> element rendered at all time.

Yes, I've done this. But I don't understand the relationship between a hx element and a date.

#7 Updated by Patrick Broens almost 6 years ago

Wolfgang Wagner wrote:

Yes, I've done this. But I don't understand the relationship between a hx element and a date.

According to the W3C specs the <header> tag should be used for the following:

The header element represents introductory content for its nearest ancestor sectioning content or sectioning root element. A header typically contains a group of introductory or navigational aids. When the nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page. A header element is intended to usually contain the section's heading (an h1–h6 element), but this is not required. The header element can also be used to wrap a section's table of contents, a search form, or any relevant logos.

In short, this is a grouping element. The date can be seen as an introductory aid. That's why it is put in header tag, when there is a hx element also. We are grouping the hx and the date by a header tag. Putting only the date in a header tag breaks the specification. You're not grouping anything, only displaying the date. Not using a hx tag, but wrapping a date with header breaks the semantics of the document also.

Since you're not grouping anything when there is only the date (same as in #47575), I would like to close this issue. The <header> tag is a grouping tag, not for a single element, and especially not combined with a hx tag (although not required). By changing this, CSC would not be according to the W3C specs anymore.

Of course, you can always change this according to your personal taste, but be aware of the right markup and semantics. The specification can be read in many ways, but I believe the way we use it currently is the best. You're always welcome to change it for your own needs ;-)

#8 Updated by Patrick Broens almost 6 years ago

  • Category changed from Frontend to Content Rendering

#9 Updated by Felix Kopp almost 5 years ago

  • Parent task set to #61842

#10 Updated by Frank Naegler almost 5 years ago

I agree to Patrick and would prefer to close this issue.

#11 Updated by Riccardo De Contardi over 4 years ago

  • Status changed from New to Closed

#12 Updated by Sebastian Schmal almost 4 years ago

the problem is in the 6.2.15 :(
plz fix the bug, thanks!

Also available in: Atom PDF