TYPO3 6.2 - rlmp_tmplselector & automaketemplate 混淆

TYPO3 6.2 - rlmp_tmplselector & automaketemplate confusion

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

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

我的站点正在使用 automaketemplate 和 rlmp_tmpselector。起初,我没有找到与 TYPO3 6.2 兼容的 rlmp_tmplselector 版本。因此,我尝试在 ts_default.ts.

中硬编码 HTML 文件

在那之后,页面有了正确的(主)模板,菜单完全填满。但是没有内容,而是 "empty" 主模板。

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 试了一下,然后按照自述文件中的描述进行了更改。但是 Body-Tag 仍然是空的。

剪辑自 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会不会是错误,我需要写什么来填充它?

提前感谢您的任何建议!

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

我的解决方案是:

  • 在我的主模板中包含静态模板css_styled_content(解决了空主体标签)
  • 将扩展 automaketemplate 更新为 0.2.0 并将 rlmp_tmplselector 更新为 2.2.1
  • 按照自述文件中的描述修改 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。

旧代码

# 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
}