2016-11-30 50 views
0

将我的TYPO3从4.5升级到6.2后,我在内容页面上看到一个空白的body标签。我没有php错误,TYPO3日志也是空的。TYPO3 6.2 - rlmp_tmplselector&automake模板混淆

经过一些(几天)的尝试和错误,我得出结论这是模板的问题。

我的网站正在使用automaketemplate和rlmp_tmpselector。起初,我没有找到与TYPO3 6.2兼容的rlmp_tmplselector版本。因此,我试图对ts_default.ts中的HTML文件进行硬编码。

之后,页面有正确的(主)模板,菜单完全填充。但不是内容,而是一个“空白”主模板。

对于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试了一下,改变它喜欢它是在自述discrived。但是身体标签仍然是空的。从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是错误的,我有什么写来填补呢?

在此先感谢您的任何建议!

回答

1

我遇到了同样的情况,而从4.5升级到6.2

该解决方案对我来说是:

  • 包括在我的主模板中的静态模板css_styled_content(解决了空body标签)
  • 将扩展automaketemplate更新为0.2.0并将rlmp_tmplselector更新为2.2.1
  • 修改自述文件中描述的TS

我得到的TS与你相似,但 在TS qouted在你的问题行

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可能没有正确包含。

+0

我自己并没有找到解决方案。所以我们外包了这个任务,但是无论如何谢谢。 –