将我的TYPO3从4.5升级到6.2后,我在内容页面上看到一个空白的正文标记。我没有php错误,TYPO3日志也是空的。
经过一些(几天)的尝试和错误,我得出的结论是模板的问题。
我的网站正在使用automaketemplate和rlmp_tmpselector。起初,我没有找到与TYPO3 6.2兼容的rlmp_tmplselector版本。因此,我尝试在ts_default.ts
。
之后,页面具有正确的(主)模板,菜单完全填满。但是,有一个"空的"而不是内容。主模板。
已经使用了rlmp_tmpselector。我在git上找到了一个新版本并安装了它。自述文件显示了一些语法更改:
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
我用原始的ts_default.ts尝试了它,并改变它,就像它在自述文件中描述的那样。但是身体标签仍然是空的。
来自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
}
}
我尝试在PHP中调试它,但是找不到任何东西。 我得到了一个线索:
typo3conf/ext/rlmp_tmplselector/Classes/Controller/TemplateSelectorController.php:
var_dump($tmplConf);
输出:
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"
}
空的defaultTemplateFileNameMain可能是错误的,我需要写什么来填充它?
提前感谢任何建议!
答案 0 :(得分:1)
我在从4.5更新到6.2
时遇到了同样的情况我的解决方案是:
我得到的TS与你的相似,但是 在TS中问你的问题行
template.content.templateType = sub
必须更改为
template.content.settings.templateType = sub
我还用
定义了模板文件tt_content.list.20.rlmptmplselector_templateselector.settings{
defaultTemplateFileNameMain = my_main_templ.html
}
所以我无法说明为什么调试输出中的defaultTemplateFileNameMain为空。调试输出似乎显示rlmp_tmplselector的默认TS。也许您在读取设置之前插入了var_dump,或者可能未正确包含整个TS。
答案 1 :(得分:0)
旧代码
# Set the main subparts in the template
page.10 = TEMPLATE
page.10 {
template =< plugin.tx_rlmptmplselector_pi1
workOnSubpart = DOCUMENT
subparts.LOGO < styles.content.getLOGO
subparts.BANNER < styles.content.getBANNER
subparts.LEFT < styles.content.getLEFT
subparts.CENTER < styles.content.getCENTER
subparts.RIGHT < styles.content.getRIGHT
subparts.FOOTER < styles.content.getFOOTER
subparts.HEADERRIGHT < styles.content.getHEADERRIGHT
subparts.CONTENTLEFT < styles.content.getCONTENTLEFT
subparts.COLOUR < styles.content.getCOLOUR
subparts.GOOGLESEARCH < styles.content.getGOOGLESEARCH
}
对此进行更新
# Set the main subparts in the template
page.10 = TEMPLATE
page.10 {
template =< tt_content.list.20.rlmptmplselector_templateselector
workOnSubpart = DOCUMENT
subparts.LOGO < styles.content.getLOGO
subparts.BANNER < styles.content.getBANNER
subparts.LEFT < styles.content.getLEFT
subparts.CENTER < styles.content.getCENTER
subparts.RIGHT < styles.content.getRIGHT
subparts.FOOTER < styles.content.getFOOTER
subparts.HEADERRIGHT < styles.content.getHEADERRIGHT
subparts.CONTENTLEFT < styles.content.getCONTENTLEFT
subparts.COLOUR < styles.content.getCOLOUR
subparts.GOOGLESEARCH < styles.content.getGOOGLESEARCH
}
旧代码:
plugin.tx_rlmptmplselector_pi1 {
templatePathMain = fileadmin/templates/html/
defaultTemplateFileNameMain = inside.html
inheritMainTemplates = 0
}
更新:
tt_content.list.20.rlmptmplselector_templateselector {
// Define the paths leading to our HTML template files
settings.templatePathMain = fileadmin/templates/html/
// Define the filenames used as the default HTML templates
settings.defaultTemplateFileNameMain = inside.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
settings.inheritMainTemplates = 0
}