after upgrading my TYPO3 from 4.5 to 6.2 I am greeted with a blank body tag on the content pages. I have no php errors and the TYPO3 log is also empty.
After some (days of) try and error, I came to the conclusion it's an issue with the template.
My site is using automaketemplate and rlmp_tmpselector. At first, I didn't find a version of rlmp_tmplselector, that is compatible with TYPO3 6.2. Because of that, I tried to hardcode the HTML file in the ts_default.ts
.
After that, the page had the correct (main) template, with the menu completely filled. But instead of the content, there was an "empty" main-template.
That for rlmp_tmpselector has been used. I found a new version on git, and installed it. The readme shows some syntax changes:
rlmp_tmplselector
=================
## Änderungen im Typoscript
In dieser Version gibt es ein paar Änderungen im Typoscript:
Bisher: (object) < plugin.tx_rlmptmplselector_pi1
Jetzt: (object) < tt_content.list.20.rlmptmplselector_templateselector
Bisher: plugin.tx_rlmptmplselector_pi1.templatePathMain =
Jetzt: tt_content.list.20.rlmptmplselector_templateselector.settings.templatePathMain =
Bisher: plugin.tx_rlmptmplselector_pi1.templatePathSub =
Jetzt: tt_content.list.20.rlmptmplselector_templateselector.settings.templatePathSub =
Bisher: template.templateType = sub
Jetzt: template.settings.templateType = sub
Bisher: template.templateType = main
Jetzt: template.settings.templateType = main
## Änderungen im TSconfig
ggf. folgende Zeilen im PageTSconfig auskommentieren
// TCEFORM.pages.tx_rlmptmplselector_main_tmpl.disabled = 1
// TCEFORM.pages.tx_rlmptmplselector_ca_tmpl.removeItems = 0
I tried it with the original ts_default.ts and changed it like it was discrived in the readme. But still the Body-Tag stays empty.
Cuts from ts_default.ts:
tt_content.list.20.rlmptmplselector_templateselector {
// Define the paths leading to our HTML template files
settings.templatePathMain = fileadmin/templates/
settings.templatePathSub = fileadmin/templates/sub/
templatePathMain = fileadmin/templates/
templatePathSub = fileadmin/templates/sub/
// Define the filenames used as the default HTML templates
defaultTemplateFileNameMain = hundb_main.html
defaultTemplateFileNameSub = einspaltig.html
settings.defaultTemplateFileNameMain = hundb_main.html
settings.defaultTemplateFileNameSub = einspaltig.html
// If there is a page having no template selected, use a template
// selected earlier in the rootline. If there is none, use the default
inheritMainTemplates = 1
inheritSubTemplates = 1
templateObjects.main {
10 < templateStandard
}
}
plugin.tx_automaketemplate_pi1 {
content < tt_content.list.20.rlmptmplselector_templateselector
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
TD.all = 1
DIV.all = 1
}
relPathPrefix = fileadmin/templates/
}
// --- SETUP SUBPARTS ----------------------------------------------------------------------
temp.contentAreaTemplate = TEMPLATE
temp.contentAreaTemplate {
template =< plugin.tx_automaketemplate_pi1
// Modify the template selector config: This is a sub template!
template.content.templateType = sub
workOnSubpart = DOCUMENT_BODY
subparts.column_normal < temp.contentnormal
subparts.column_left < temp.contentleft
subparts.column_right < temp.contentright
}
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template =< plugin.tx_automaketemplate_pi1
workOnSubpart = DOCUMENT_BODY
subparts {
content < temp.contentAreaTemplate
mainmenu < temp.mainmenu
figur < temp.figur
logo < temp.logo
headertextc < temp.headertextc
headertextb < temp.headertextb
headertexta < temp.headertexta
}
}
I tried debugging it in PHP but wasn't able to find anything. A clue I got:
typo3conf/ext/rlmp_tmplselector/Classes/Controller/TemplateSelectorController.php:
var_dump($tmplConf);
Outputs:
runarray(10) {
["templateType"]=>
string(4) "main"
["templatePathMain"]=>
string(24) "fileadmin/template/main/"
["templatePathSub"]=>
string(23) "fileadmin/template/sub/"
["defaultTemplateFileNameMain"]=>
string(0) ""
["defaultTemplateFileNameSub"]=>
string(0) ""
["defaultTemplateObjectMain"]=>
string(2) "10"
["defaultTemplateObjectSub"]=>
string(2) "10"
["templateObjects."]=>
array(2) {
["main"]=>
string(0) ""
["sub"]=>
string(0) ""
}
["inheritMainTemplates"]=>
string(1) "0"
["inheritSubTemplates"]=>
string(1) "0"
}
Could the empty defaultTemplateFileNameMain be the mistake, what do I have to write to fill it?
Thanks in advance for any advice!
I ran into the same situation while updating from 4.5 to 6.2
The solution for me was:
My resulting TS is similar to yours, but in the TS qouted in your question the line
template.content.templateType = sub
must be changed to
template.content.settings.templateType = sub
I also defined the template file with
tt_content.list.20.rlmptmplselector_templateselector.settings{
defaultTemplateFileNameMain = my_main_templ.html
}
so I can't tell why the defaultTemplateFileNameMain in your debug output is empty. The debug output seems to show the default TS of rlmp_tmplselector. Maybe you inserted the var_dump before the settings are read or the whole TS might not be included correctly.