[TYPO3-mvc] Switching Templates with flexform

Jochen Rau jochen.rau at typoplanet.de
Mon Jan 4 16:13:20 CET 2010


Hi Nils.

On 04.01.10 16:00, Nils Blattner wrote:
> Is it possible to switch fluid templates according to a flexform field
> (linkfield) such that I could specify a different template for every
> instance of a plugin?
>
> Or could I use TypoScript to set the fluid template path as in oldschool
> extensions?

Both. You can use TypoScript (as in the BlogExample):

plugin.tx_blogexample {
	view {
		templateRootPath = foo/bar/baz/
		partialRootPath = foo/bar/baz/
		layoutRootPath = foo/bar/baz/
	}
}

or FlexForm (overrides TypoScript):

<T3DataStructure>
   <sheets>
     <sDEF>
       <ROOT>
         <TCEforms>
           <sheetTitle>Options</sheetTitle>
         </TCEforms>
         <type>array</type>
         <el>
           <view.templateRootPath>
             <TCEforms>
               <label>Template Root Path</label>
               <config>
                 <type>input</type>
                 <size>20</size>
               </config>
             </TCEforms>
           </view.templateRootPath>
         </el>
	[...]
       </ROOT>
     </sDEF>
   </sheets>
</T3DataStructure>

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list