[TYPO3-mvc] shared templates/partials? Or something like skin support for FLUID/FLOW3/ExtBase

Jochen Rau jochen.rau at typoplanet.de
Mon Apr 12 20:40:28 CEST 2010


Hi Christine.

On 12.04.10 20:22, Christine Gerpheide wrote:
> Just a note because in one of our extensions we needed something similar.
>   In our case we were switching between HTML and XML templates, based on the
> presense of the GET parameter type=101.  What we did was inside our
> Resources folder, in addition to all the Controller template folders, we
> created an extra folder "xml/" in which we again had all of the Controller
> template folders (but the templates were XML).  Then we created an abstract
> controller with an initializeView method that would read the type variable
> and if set to 101, then use $view::('our_xml_folder'), which all of our
> Controllers extended.  Furthermore, we had to override the Controller
> redirect method so that when performing redirects, it would keep the type
> variable the same.
>
> Just thought I'd mention, because we ran into a similar need.  The least
> convenient part of this was overriding the redirect method, so a scheme like
> Franz describes would have been nice.

Did you notice, how the switch from index.html to index.txt is done in 
the BlogExample. You just have toadd a format parameter to the URI:

<f:link.action arguments="{blog : blog}" format="txt" 
target="_blank">Show posts as plain text</f:link.action>

resulting in

http://localhost/dev/index.php?id=99&tx_blogexample_pi1[blog]=1&tx_blogexample_pi1[controller]=Post&tx_blogexample_pi1[format]=txt

Does that meet your needs?

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list