0
votes

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!

2

2 Answers

2
votes

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.

0
votes

Old code

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

Update to this

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

Old code:

plugin.tx_rlmptmplselector_pi1 {
    templatePathMain = fileadmin/templates/html/
    defaultTemplateFileNameMain = inside.html
    inheritMainTemplates = 0
}

Update to this:

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
}