[Typo3] Main html template selector

tapio tapio.markula at dnainternet.net
Sat Nov 26 19:46:15 CET 2005


Pierre Rouwens wrote:
> Hi T3ers,
> 
> I need some advise, i'm using T3 3.8.1 and need to make possible to 
> choose wich main html template tue user wanna use when create a page.
> I've tried rlmp_tmplselector, it works fine but i can't use 
> subparts.content < styles.content.get ...
> I don't wanna use the possibility to choose a sub template... what can i 
> do i've read the documentation but don't fond a way to achieve this... i 
> can make a sub template and use it by default it's ok for the customer 
> but i don't know what it must exactly contains ??
> Any hints please
> 
> Pierre


Look at the documentation of Modern Template Building I-II, but do 
following changes:

ext: Auto-parser plugin (you found this in the documentation

# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
   # Read the template file:
   #content = FILE
   #content.file = fileadmin/template/main/template_1.html
   #content < plugin.tx_tmplselect_pi1  - replace with the following line
   content < plugin.tx_rlmptmplselector_pi1
...
}

ADD following:

plugin.tx_rlmptmplselector_pi1 {

		# Template type. Default is "main". Allowed values: "main", "sub"
	templateType = main

		# Paths to search for templates in HTML file mode (vs. TS mode)		
	templatePathMain = fileadmin/template/main/
	templatePathSub = fileadmin/template/sub/

       # Refers to the default template file name to use
       # if no value is set for the current page
    defaultTemplateFileNameMain = {$defaultTemplateFileName}
    defaultTemplateFileNameSub = {$contentAreaTemplateFile}

       # Refers to the default template object to use
       # if no value is set for the current page
    defaultTemplateObjectMain = 10
    defaultTemplateObjectSub = 10

		# Contains TEMPLATE objects for TS mode (vs. external HTML file mode)
    templateObjects.main =
    templateObjects.sub =

		# Use the template selected earlier in the rootline of no template 
was selected	
	inheritMainTemplates = 0
	inheritSubTemplates = 1
}

Note that you don't need to make the plugin 'tmplselect' (I made it 
according to instructions). With changes above I got 'rlmptmplselector' 
to work instead of 'tmplselect'.

I recommend to install then also 'stfl_tmpl2columns', when the
columns match with the selected templates.

Works fine!



More information about the TYPO3-english mailing list