2016-11-30 32 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

我自己並沒有找到解決方案。所以我們外包了這個任務,但是無論如何謝謝。 –