[!!!][FEATURE] Streamline Fluid Styled Content and CSS Styled Content
[Packages/TYPO3.CMS.git] / typo3 / sysext / css_styled_content / Configuration / TypoScript / Helper / StandardHeader.txt
1 # Default configuration for content elements which still use a default header (e.g. all Extbase CTypes, or EXT:felogin)
2 lib.stdheader = COA
3 lib.stdheader {
4     # Create class attribute for <Hx> tags
5     3 = LOAD_REGISTER
6     3 {
7         headerClass {
8             cObject = COA
9             cObject {
10                 # Create alignment class for <Hx> tags
11                 10 = TEXT
12                 10 {
13                     field = header_position
14                     required = 1
15                     noTrimWrap = |csc-header-alignment-| |
16                 }
17                 # Create "csc-firstHeader" class for <Hx> tags
18                 20 = TEXT
19                 20 {
20                     value = csc-firstHeader
21                     if {
22                         value = 1
23                         equals.data = cObj:parentRecordNumber
24                     }
25                 }
26                 stdWrap {
27                     trim = 1
28                     noTrimWrap = | class="|"|
29                     required = 1
30                 }
31             }
32         }
33     }
34     # Date format (not HTML5)
35     5 = TEXT
36     5 {
37         field = date
38         if {
39             isTrue {
40                 field = date
41             }
42             isFalse = 1
43             isFalse {
44                 if {
45                     value = html5
46                     equals.data = TSFE:config|config|doctype
47                 }
48             }
49         }
50         strftime = %x
51         wrap = <p class="csc-header-date">|</p>
52         prefixComment = 2 | Header date:
53     }
54     # This CASE cObject renders the header content:
55     # currentValue is set to the header data, possibly wrapped in link-tags.
56     10 = CASE
57     10.setCurrent {
58         field = header
59         htmlSpecialChars = 1
60         typolink.parameter.field = header_link
61     }
62     10.key.field = header_layout
63     10.key.ifEmpty = {$content.defaultHeaderType}
64     10.key.ifEmpty.override.data = register: defaultHeaderType
65     10.1 = TEXT
66     10.1.current = 1
67     10.1.dataWrap = <h1{register:headerClass}>|</h1>
68     10.2 < .10.1
69     10.2.dataWrap = <h2{register:headerClass}>|</h2>
70     10.3 < .10.1
71     10.3.dataWrap = <h3{register:headerClass}>|</h3>
72     10.4 < .10.1
73     10.4.dataWrap = <h4{register:headerClass}>|</h4>
74     10.5 < .10.1
75     10.5.dataWrap = <h5{register:headerClass}>|</h5>
76     # HTML5 subheader
77     20 = CASE
78     20 {
79         key.field = header_layout
80         key.ifEmpty = {$content.defaultHeaderType}
81         key.ifEmpty.override.data = register: defaultHeaderType
82         default = TEXT
83         default {
84             wrap = <h2>|</h2>
85             htmlSpecialChars = 1
86             field = subheader
87         }
88         1 < .default
89         2 < .default
90         2.wrap = <h3>|</h3>
91         3 < .default
92         3.wrap = <h4>|</h4>
93         4 < .default
94         4.wrap = <h5>|</h5>
95         5 < .default
96         5.wrap = <h6>|</h6>
97         if {
98             isTrue {
99                 field = subheader
100             }
101             value = html5
102             equals.data = TSFE:config|config|doctype
103         }
104     }
105     # HTML5 Date
106     40 = COA
107     40 {
108         stdWrap {
109             wrap = <p class="csc-header-date">|</p>
110             innerWrap {
111                 cObject = COA
112                 cObject {
113                     10 = TEXT
114                     10 {
115                         value = <time
116                     }
117                     20 = TEXT
118                     20 {
119                         noTrimWrap = | datetime="|"|
120                         field = date
121                         strftime = %Y-%m-%d
122                     }
123                     30 = TEXT
124                     30 {
125                         value = >|</time>
126                     }
127                 }
128             }
129             required = 1
130         }
131         10 = TEXT
132         10 {
133             field = date
134             strftime = %B %e, %Y
135         }
136         if {
137             isTrue {
138                 field = date
139             }
140             value = html5
141             equals.data = TSFE:config|config|doctype
142         }
143     }
144     # Pops the used registers off the stack:
145     98 = RESTORE_REGISTER
146     # Post-processing:
147     stdWrap.fieldRequired = header
148     stdWrap.if {
149         equals.field = header_layout
150         value = 100
151         negate = 1
152     }
153     stdWrap.editIcons = tt_content : header, [header_layout | header_position], [header_link|date]
154     stdWrap.editIcons.beforeLastTag = 1
155     stdWrap.editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.header
156     stdWrap {
157         dataWrap = <div class="csc-header csc-header-n{cObj:parentRecordNumber}">|</div>
158         dataWrap {
159             override = <header class="csc-header csc-header-n{cObj:parentRecordNumber}">|</header>
160             override {
161                 if {
162                     isTrue {
163                         field = date
164                     }
165                     value = html5
166                     equals.data = TSFE:config|config|doctype
167                 }
168             }
169         }
170     }
171     stdWrap.prefixComment = 2 | Header:
172 }