首页 文章

TYPO3 6.2 - rlmp_tmplselector和automaketemplate混淆

提问于
浏览
0

将我的TYPO3从4.5升级到6.2后,我在内容页面上看到一个空白的正文标记 . 我没有php错误,TYPO3日志也是空的 .

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

我的网站使用的是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尝试了它,并改变它就像在自述文件中描述的那样 . 但身体标签仍然是空的 .

来自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 回答

  • 1

    我在从4.5更新到6.2时遇到了同样的情况

    我的解决方案是:

    • 包括我主模板中的静态模板css_styled_content(解决了空体标签)

    • 将扩展名automaketemplate更新为0.2.0,将rlmp_tmplselector更新为2.2.1
      如自述文件中所述

    • 修改TS

    我得到的TS类似于你的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 .

相关问题