Bug #86979
Updated by Josef Glatz over 5 years ago
h1. Problem/Description
h4. The following TypoScript snippet works with TYPO3 8 LTS:
<pre>
page {
bodyTagCObject = COA
bodyTagCObject {
stdWrap.wrap = <body id="top"|>
# attribute class
10 = COA
10 {
stdWrap {
noTrimWrap = | class="|"|
required = 1
}
# Add current language
20 = TEXT
20 {
value = language-{TSFE:sys_language_uid} languagecontent-{TSFE:sys_language_content}
insertData = 1
noTrimWrap = || |
}
# Add level
25 = TEXT
25 {
value = level-{level:0}
insertData = 1
noTrimWrap = || |
}
# Add uid of optional FE-layout
40 = TEXT
40 {
fieldRequired = layout
value = layout-{field:layout}
insertData = 1
noTrimWrap = | ||
}
# Add uid of rootpage
50 = TEXT
50 {
value = root-{leveluid:0}
insertData = 1
noTrimWrap = | ||
}
# Add class if it's the rootpage
60 = TEXT
60 {
fieldRequired = is_siteroot
value = rootpage
noTrimWrap = | ||
}
}
# attribute(s) data-*
20 = COA
20 {
# Add page UID
10 = TEXT
10 {
value = data-page-uid="{field:uid}"
insertData = 1
noTrimWrap = | ||
}
}
}
}
</pre>
"Link to the working code snippet of my TYPO3 Distribution":https://github.com/josefglatz/TYPO3-Distribution/blob/master/app/web/typo3conf/ext/theme/Configuration/TypoScript/Base/Page/Page.setupts#L252
__
h4. The following objects does not appear anymore when it should apply on a proper page:
h5. @page.bodyTagCObject.10.60@ does not render anything
<pre><code class="text">
# Add class if it's the rootpage
60 = TEXT
60 {
fieldRequired = is_siteroot
value = rootpage
noTrimWrap = | ||
}
</code></pre>
It seems like the page field @is_siteroot@ isn't true. But it works when rendering the value, and it shows 1 on the root page. So @fieldRequired@ get's not "true"
* instead of @ rootpage@
* nothing is rendered/returned by this object
h5. @page.bodyTagCObject.20.10@ does not render @{field:uid}@
<pre><code class="text">
# Add page UID
10 = TEXT
10 {
value = data-page-uid="{field:uid}"
insertData = 1
noTrimWrap = | ||
}
</code></pre>
** instead of @data-page-uid="1"@
** only @data-page-uid=""@ is rendered
---
h4. Just to re-check: the following snippet is working fine on the same page
<pre><code class="text">
page {
4 = TEXT
4 {
field = is_siteroot
fieldRequired = is_siteroot
wrap = <h1>|</h1>
}
5 = TEXT
5 {
field = uid
wrap = <h2>|</h2>
}
}
</code></pre>
h1. Acceptance Criteria
* Such a straight forward TypoScript setup must work, as there should be no breaking changes in this area after upgrading to TYPO3 9 LTS.