2013-02-01 50 views
0

我想在我的TYPO3網站的所有頁面中顯示相同的頁腳內容。接下來是流體模板概念。我創建了3個模板。如何將頁面內容插入到TYPO3的默認模板中?

1.default template(main.html) 
    2.content template 
    3.allpage_content template(which need to show in all pages) 

也希望這些內容可編輯的富文本Editor.So我創建了一個名爲頁面頁腳和調用後端佈局(allpage_content.html)。

對於:

lib.footer = COA 
    lib.footer { 
     10 = CONTENT 
     10 { 
      table = tt_content 
      select.where = colPos = 10 
      select.orderBy = sorting 
      select.pidInList = 15 
      } 

     } 



page.100 = TEMPLATE 
page.100.template = FILE 
page.100.template.file = fileadmin/templates/main.html 
page.100.workOnSubpart = DOCUMENT_BODY 
page.100.marks.content < lib.footer 

除此之外後端的佈局也與真正的前臺模板連接

footer_left < styles.content.get 
footer_left.select.where = colPos = 10 

回答

3

請嘗試以下Typo腳本:

lib.footer = COA 
lib.footer { 
10 = RECORDS 
10{ 
    tables = tt_content 
    source = 15 #footer page id 
} 
} 

OR

lib.footer = COA 
lib.footer { 
10 = CONTENT 
10 { 
table = tt_content 
    select.where = colPos = 0  #column position - 0-normal, 1-left, 2-right, 3-border 
    select.orderBy = sorting 
    select.pidInList = 15 #footer page id 
} 
} 
+0

謝謝。我們應該添加列的位置,如: - 「select.where = colPos = 0,1,2,3」我的意思是多於一個列位置 – sherin

+1

是的。 colPos = 0爲正常列,= 1爲左列,= 2爲右列,= 3爲邊界 –

+0

我的意思是多於一個列位置像這樣select.where = colPos = 0,1,2,3 – sherin

1

以下是我的操作方法。 您可以使用臨時對象(它們不會持久)。 在下面的例子中,只使用bodytext(RTE字段),沒有別的。 內容通過lib.parsefunc_RTE呈現,因此呈現鏈接。 我選擇只挑選一個內容元素(select.max),但這取決於您

temp.footer_adr = CONTENT 
temp.footer_adr { 
    table = tt_content 
    select.pidInList = 47 
    select.languageField = sys_language_uid 
    select.max = 1 
    select.begin = 1 
    select.selectFields = bodytext 
    renderObj=TEXT 
    renderObj{ 
     required=1 
     wrap=| 
     field=bodytext 
     parseFunc = < lib.parseFunc_RTE 
    } 
} 

page.70 = TEMPLATE 
page.70 { 
    template = FILE 
    template.file = fileadmin/templates/main/tmpl/footer.html 
    marks { 
      FOOTER_ADR < temp.footer_adr 
    } 
} 
相關問題