Feature #25282
closeduid of content Element should be wrappt into wrapping div not prepended a-Element
0%
Description
Since every content element should be considered as "section" while outlining a document its confusing that anchors for those sections are not inside those elements but outside them.
Also if you interact with JavaScript/DOM and you count content elements you have more nodes than content elements.
Solution: 1) wrap the prefixed anchor into the wrapping div element or even better 2) place the uid of the content element as id attribute directly to the div element.
This TypoScript Setup places the id attribute direclty into a wrapping div element for each content element (and the translated version for the translated records)
tt_content.stdWrap {
innerWrap.cObject {
default {
10 {
override.cObject >
override.cObject = TEXT
override.cObject {
value = <div id="c{field:_LOCALIZED_UID}"
if.isTrue.field = _LOCALIZED_UID
}
}
}
}
prepend >
}
for further compatiblity with HTML5 this div element can simply be renamed to section (if config.doctype is set to html_5) - since it will help the outlining process:
<section id="c1"></section
is much more semantic than
<a id="c1" />
<div>
foo
</div>
(issue imported from #M17895)