dozabg1616 2016-11-30 15:46
浏览 43
已采纳

TYPO3 6.2 - rlmp_tmplselector和automaketemplate混淆

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!

  • 写回答

1条回答 默认 最新

  • doudun5009 2017-08-16 21:23
    关注

    I ran into the same situation while updating from 4.5 to 6.2

    The solution for me was:

    • including the static template css_styled_content in my main template (solved the empty body tag)
    • updating the extensions automaketemplate to 0.2.0 and rlmp_tmplselector to 2.2.1
    • modifying the TS as described in the readme

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大