[TYPO3] how to substitute a template.file in an extension template?

Tomasz Chmielewski mangoo at wpkg.org
Fri Oct 26 11:36:28 CEST 2007


I have a template which is used for all pages. For some of the pages, I 
would like to use a different template file.

Instead of copying the whole template, it is better to use an extension 
template for small changes.
After some testing, I realized that an extension template has to look 
like below:

### Extension template - start

# New template file
temp.mainTemplate.template.file = fileadmin/templates/newfile.htm

# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate

### Extension template - end


Indeed, the page gets look&feel defined in "newfile.htm", but 
unfortunately, all "###marks###" are gone. For example, in the main 
template I substituted ###SEARCH### marks with a search form:

### Search - Start
page.10.marks.SEARCH < tt_content.search.30
page.10.marks.SEARCH.dataArray >
(...)


On a page with an extension template, there is no search form, but 
###SEARCH### visible to the end user.

This means that my method of substituting a template.file in an 
extension file is wrong. What is the correct way to do it?


-- 
Tomasz Chmielewski
http://blog.wpkg.org


More information about the TYPO3-english mailing list