Reputation: 783
I want the following result with the TYPO3 content element "header":
<header>
<figure><img src="image.png" alt="Page Title"></figure>
<div>
<h1>Header</h1>
<h2>Subheader</h2>
</div>
</header>
With the following typoscript i get the most of it, but i have a problem on wrapping the h tags
## Wrap header with <header>
lib.stdheader.stdWrap.dataWrap.override = <header class="header-n{cObj:parentRecordNumber}">|</header>
## Header set with image
lib.stdheader.10.11 = COA
lib.stdheader.10.11 {
1 = IMAGE
1 {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
altText = TEXT
altText.data = page : title
titleText = TEXT
titleText.data = page : title
wrap = <figure>|</figure>
}
2 < lib.stdheader.10.1
}
But sadly the result is just:
<header class="header-n1">
<figure><img src="image.png" width="1112" height="546" alt="Pagetitle"></figure>
<h1 class="csc-firstHeader">Header</h1>
<h2>Subheader</h2>
</header>
Whats the magic to get h1 & h2 wrapped?
if i do it like that
2 = COA
2 {
1 < lib.stdheader.10.1
2 < lib.stdheader.10.2
wrap = <div>|</div>
}
the header text is just doubled like
<header class="header-n1">
<figure><img src="image.png" width="1112" height="546" alt="Pagetitle"></figure>
<div>
<h1 class="csc-firstHeader">Header</h1>
<h2 class="csc-firstHeader">Header</h2>
</div>
<h2>Subheader</h2>
</header>
I´m using TYPO3 6.2
Upvotes: 0
Views: 1200
Reputation: 9671
lib.stdheader.10.*
are actually within a case statement, so only one of them will be taken.
You can do something like that:
lib.stdheader.stdWrap.dataWrap.override = <header class="header-n{cObj:parentRecordNumber}">|</header>
lib.stdheader.10.11 = COA
lib.stdheader.10.11 {
1 = IMAGE
1 {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
altText = TEXT
altText.data = page : title
titleText = TEXT
titleText.data = page : title
wrap = <figure>|</figure>
}
2 = COA
2 {
wrap = <div>|</div>
10 = TEXT
10 {
data = page : title
wrap = <h1>|</h1>
}
20 = TEXT
20 {
data = page:subtitle
wrap = <h2>|</h2>
}
}
}
Mind you, the original header functionality (like links etc.) is not being used anymore. You'll have to add it yourself if you need it.
Upvotes: 0