[TASK] Functional test for tt_content rendering
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / Fixtures / Frontend / JsonRenderer.ts
1 config {
2         no_cache = 1
3         debug = 0
4         xhtml_cleaning = 0
5         admPanel = 0
6         disableAllHeaderCode = 1
7         sendCacheHeaders = 0
8         sys_language_uid = 0
9         sys_language_mode = ignore
10         sys_language_overlay = 1
11         additionalHeaders = Content-Type: application/json; charset=utf-8
12
13         watcher {
14                 tableFields {
15                         pages = uid,_PAGES_OVERLAY_UID,pid,sorting,title,tx_irretutorial_hotels
16                         sys_category = uid,_ORIG_uid,_LOCALIZED_UID,pid,sys_language_uid,title,parent,items,sys_language_uid
17                         sys_file = uid,_ORIG_uid,_LOCALIZED_UID,pid,title,sys_language_uid
18                         sys_file_reference = uid,_ORIG_uid,_LOCALIZED_UID,title,description,alternative,link,missing,identifier,file,pid,sys_language_uid,title,parent,items,sys_language_uid,uid_local,uid_foreign,tablenames,fieldname,table_local
19                         tt_content = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,header,categories,tx_irretutorial_1nff_hotels
20                         tx_irretutorial_1nff_hotel = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,offers
21                         tx_irretutorial_1nff_offer = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,prices
22                         tx_irretutorial_1nff_price = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,price
23                         tx_irretutorial_1ncsv_hotel = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,offers
24                         tx_irretutorial_1ncsv_offer = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,prices
25                         tx_irretutorial_1ncsv_price = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title,price
26                         tx_testdatahandler_element = uid,_ORIG_uid,_LOCALIZED_UID,pid,sorting,sys_language_uid,title
27                 }
28         }
29 }
30
31 lib.watcherDataObject = COA
32 lib.watcherDataObject {
33         1 = LOAD_REGISTER
34         1.watcher.dataWrap = |
35         2 = USER
36         2.userFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Collector->addRecordData
37         99 = RESTORE_REGISTER
38 }
39
40 lib.watcherFileObject = COA
41 lib.watcherFileObject {
42         1 = LOAD_REGISTER
43         1.watcher.dataWrap = |
44         2 = USER
45         2.userFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Collector->addFileData
46         99 = RESTORE_REGISTER
47 }
48
49 page = PAGE
50 page {
51         10 = COA
52         10 {
53                 1 = LOAD_REGISTER
54                 1.watcher.dataWrap = pages:{field:uid}
55                 2 = USER
56                 2.userFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Collector->addRecordData
57                 10 = CONTENT
58                 10 {
59                         stdWrap.required = 1
60                         table = pages
61                         select {
62                                 orderBy = sorting
63                                 pidInList = this
64                                 # prevent sys_language_uid lookup
65                                 languageField = 0
66                         }
67                         renderObj < lib.watcherDataObject
68                         renderObj.1.watcher.dataWrap = {register:watcher}|.__pages/pages:{field:uid}
69                 }
70                 15 = CONTENT
71                 15 {
72                         if.isTrue.field = tx_irretutorial_hotels
73                         table = tx_irretutorial_1nff_hotel
74                         select {
75                                 orderBy = sorting
76                                 where.field = uid
77                                 where.intval = 1
78                                 where.wrap = parenttable='pages' AND parentid=|
79                         }
80                         renderObj < lib.watcherDataObject
81                         renderObj.1.watcher.dataWrap = {register:watcher}|.tx_irretutorial_hotels/tx_irretutorial_1nff_hotel:{field:uid}
82                 }
83                 20 = CONTENT
84                 20 {
85                         table = tt_content
86                         select {
87                                 orderBy = sorting
88                                 where = colPos=0
89                         }
90                         renderObj < lib.watcherDataObject
91                         renderObj.1.watcher.dataWrap = {register:watcher}|.__contents/tt_content:{field:uid}
92                         renderObj {
93                                 10 = CONTENT
94                                 10 {
95                                         if.isTrue.field = categories
96                                         table = sys_category
97                                         select {
98                                                 pidInList = root,-1
99                                                 selectFields = sys_category.*
100                                                 join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
101                                                 where.data = field:_ORIG_uid // field:_LOCALIZED_UID // field:uid
102                                                 where.intval = 1
103                                                 where.wrap = sys_category_record_mm.uid_foreign=|
104                                                 orderBy = sys_category_record_mm.sorting_foreign
105                                                 languageField = sys_category.sys_language_uid
106                                         }
107                                         renderObj < lib.watcherDataObject
108                                         renderObj.1.watcher.dataWrap = {register:watcher}|.categories/sys_category:{field:uid}
109                                 }
110                                 20 = CONTENT
111                                 20 {
112                                         if.isTrue.field = tx_irretutorial_1nff_hotels
113                                         table = tx_irretutorial_1nff_hotel
114                                         select {
115                                                 orderBy = sorting
116                                                 where.field = uid
117                                                 where.intval = 1
118                                                 where.wrap = parenttable="tt_content" AND parentid=|
119                                         }
120                                         renderObj < lib.watcherDataObject
121                                         renderObj.1.watcher.dataWrap = {register:watcher}|.tx_irretutorial_1nff_hotels/tx_irretutorial_1nff_hotel:{field:uid}
122                                         renderObj {
123                                                 10 = CONTENT
124                                                 10 {
125                                                         if.isTrue.field = offers
126                                                         table = tx_irretutorial_1nff_offer
127                                                         select {
128                                                                 orderBy = sorting
129                                                                 where.field = uid
130                                                                 where.intval = 1
131                                                                 where.wrap = parenttable="tx_irretutorial_1nff_hotel" AND parentid=|
132                                                         }
133                                                         renderObj < lib.watcherDataObject
134                                                         renderObj.1.watcher.dataWrap = {register:watcher}|.offers/tx_irretutorial_1nff_offer:{field:uid}
135                                                         renderObj {
136                                                                 10 = CONTENT
137                                                                 10 {
138                                                                         if.isTrue.field = prices
139                                                                         table = tx_irretutorial_1nff_price
140                                                                         select {
141                                                                                 orderBy = sorting
142                                                                                 where.field = uid
143                                                                                 where.intval = 1
144                                                                                 where.wrap = parenttable="tx_irretutorial_1nff_offer" AND parentid=|
145                                                                         }
146                                                                         renderObj < lib.watcherDataObject
147                                                                         renderObj.1.watcher.dataWrap = {register:watcher}|.prices/tx_irretutorial_1nff_price:{field:uid}
148                                                                 }
149                                                         }
150                                                 }
151                                         }
152                                 }
153                                 30 = CONTENT
154                                 30 {
155                                         if.isTrue.field = tx_irretutorial_1ncsv_hotels
156                                         table = tx_irretutorial_1ncsv_hotel
157                                         select {
158                                                 uidInList.data = field:tx_irretutorial_1ncsv_hotels
159                                                 orderBy = sorting
160                                                 # prevent sys_language_uid lookup
161                                                 languageField = 0
162                                         }
163                                         renderObj < lib.watcherDataObject
164                                         renderObj.1.watcher.dataWrap = {register:watcher}|.tx_irretutorial_1ncsv_hotels/tx_irretutorial_1ncsv_hotel:{field:uid}
165                                         renderObj {
166                                                 10 = CONTENT
167                                                 10 {
168                                                         if.isTrue.field = offers
169                                                         table = tx_irretutorial_1ncsv_offer
170                                                         select {
171                                                                 uidInList.data = field:offers
172                                                                 orderBy = sorting
173                                                                 # prevent sys_language_uid lookup
174                                                                 languageField = 0
175                                                         }
176                                                         renderObj < lib.watcherDataObject
177                                                         renderObj.1.watcher.dataWrap = {register:watcher}|.offers/tx_irretutorial_1ncsv_offer:{field:uid}
178                                                         renderObj {
179                                                                 10 = CONTENT
180                                                                 10 {
181                                                                         if.isTrue.field = prices
182                                                                         table = tx_irretutorial_1ncsv_price
183                                                                         select {
184                                                                                 uidInList.data = field:prices
185                                                                                 orderBy = sorting
186                                                                                 # prevent sys_language_uid lookup
187                                                                                 languageField = 0
188                                                                         }
189                                                                         renderObj < lib.watcherDataObject
190                                                                         renderObj.1.watcher.dataWrap = {register:watcher}|.prices/tx_irretutorial_1ncsv_price:{field:uid}
191                                                                 }
192                                                         }
193                                                 }
194                                         }
195                                 }
196                                 40 = FILES
197                                 40 {
198                                         if.isTrue.field = image
199                                         references {
200                                                 fieldName = image
201                                         }
202                                         renderObj < lib.watcherFileObject
203                                         renderObj.1.watcher.dataWrap = {register:watcher}|.image/
204                                 }
205                                 50 = CONTENT
206                                 50 {
207                                         if.isTrue.field = tx_testdatahandler_select
208                                         table = tx_testdatahandler_element
209                                         select {
210                                                 uidInList.data = field:tx_testdatahandler_select
211                                                 pidInList = 0
212                                                 orderBy = sorting
213                                                 # prevent sys_language_uid lookup
214                                                 languageField = 0
215                                         }
216                                         renderObj < lib.watcherDataObject
217                                         renderObj.1.watcher.dataWrap = {register:watcher}|.tx_testdatahandler_select/tx_testdatahandler_element:{field:uid}
218                                 }
219                                 60 = CONTENT
220                                 60 {
221                                         if.isTrue.field = tx_testdatahandler_group
222                                         table = tx_testdatahandler_element
223                                         select {
224                                                 uidInList.data = field:tx_testdatahandler_group
225                                                 pidInList = 0
226                                                 orderBy = sorting
227                                                 # prevent sys_language_uid lookup
228                                                 languageField = 0
229                                         }
230                                         renderObj < lib.watcherDataObject
231                                         renderObj.1.watcher.dataWrap = {register:watcher}|.tx_testdatahandler_group/tx_testdatahandler_element:{field:uid}
232                                 }
233                         }
234                 }
235                 stdWrap.postUserFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Collector->attachSection
236                 stdWrap.postUserFunc.as = Default
237         }
238         99999 = COA
239         99999 {
240                 stdWrap.postUserFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Renderer->renderValues
241                 stdWrap.postUserFunc.values {
242                         page.children {
243                                 uid.data = page:uid
244                                 pid.data = page:pid
245                                 title.data = page:title
246                         }
247                         tsfe.children {
248                                 sys_language_uid.data = tsfe:sys_language_uid
249                                 sys_language_mode.data = tsfe:sys_language_mode
250                                 sys_language_content.data = tsfe:sys_language_content
251                                 sys_language_contentOL.data = tsfe:sys_language_contentOL
252                         }
253                 }
254                 stdWrap.postUserFunc.as = Scope
255         }
256         stdWrap.postUserFunc = TYPO3\CMS\Core\Tests\Functional\Framework\Frontend\Renderer->renderSections
257 }
258
259 [globalVar = GP:L = 1]
260 config.sys_language_uid = 1
261 [end]
262 [globalVar = GP:L = 2]
263 config.sys_language_uid = 2
264 [end]
265 [globalVar = GP:L = 3]
266 config.sys_language_uid = 3
267 [end]