[TYPO3-mvc] 3 questions reagarding fluid and extbase

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Nov 30 15:46:06 CET 2010


Hey Kai,

> wow Extbase and Fluid are very impressive ;)
>
> I do have 3 important questions:
>
> 1. I want to set up the used template via TYPOScript for a controller.
>     (Therefore there must be a way to bypass the convention and change
>      the Templatefile in the controller or via TS on a different way)
>     Is there anyway to do that?
>     (Just to prevent lost templatte changes on updating the extension)

Depends on what you need. By default you can switch the overall template 
path via TS (as well as the path for partials and layouts).

plugin.tx_yourext.view {
	templateRootPath = fileadmin/...
	partialRootPath = fileadmin/...
	layoutRootPath = fileadmin/...
}

But please be aware that you have to provide ALL templates and partials 
for that extension in those folders then.


If you only like to switch a template for a certain controller or 
provide a layout selector or something in your flexforms you will have 
to override the "setViewConfiguration" method in your controller. Or, 
pass the layout setting to the view and use it to render a certain 
section or partial there.


> 2. Is there anyway to calculate a typoscript objectpath?
>     I need to pass some values, which are calculated using TS, to an
>     JSON-APIServer

I suppose you need to calculate that in the view. There is a viewHelper 
to access/render a TS object path.

<f:cObject typoscriptObjectPath="lib.your.TSobject" 
currentValueKey="nameOfAProperty">{someObject}</f:cObject>

As you can see in the example, you can pass objects to the viewHelper 
and it will convert it's properties automatically to an array that's 
accessible from within the TS then. If that doesn't work for you, you 
always can create your own viewHelper doing some maths.


> 3. after using json decode i do have problems using the .-Notation in
>     Fluid
>     http://forge.typo3.org/issues/8534
>     Is there anyway to bypass/solve that problem?
>     (Should be possible with an own viewHelper)

Sorry, can't help you with that.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list