[TYPO3-mvc] Pass data from controller action to fluid page template

Jan Kornblum jan.kornblum at gmx.de
Sat Dec 6 13:23:30 CET 2014


Hi Helmut,

>> Ups, silly question... Sorry.
>
> No worries. I just couldn't resist to frame that joke.
>
> I still would be interested what your initial issue was to think in that 
> direction. Maybe we can help with another solution …

My initial issue was caused by the fact, that it is possible to 
manipulate $GLOBALS['TSFE']->page['title'] (and similar fields) from 
inside an controller action (what i regularly do for "title", 
"keywords" and "description" in any showAction).

The scenario is: There is a page.10 FLUIDTEMPLATE showing e.g. 
{data.title} and {data.subtitle} for regular pages. Then, there also is 
a plugins detailpage (showAction). On this page i intended to 
manipulate {data.title} etc. with content generated inside the 
controller action.

I know, there are any other possibilities to solve this: One of these 
is to have an additional page.10 FLUIDTEMPLATE for the plugins 
detailpage (and putting the relevant parts from the page.10 
FLUIDTEMPLATE markup inside the plugins FLUIDTEMPLATE).

The other possibility is: Having just one page.10 FLUIDTEMPLATE and 
instead of using {data.title} there, use a typoscript object path (e.g. 
"lib.pageTitle") and inside this typoscript object get the "title" by a 
CASE object ("use page title or, if plugins showActions GET params 
exist, get the records title from db using the RECORDS object").

Both works. My initial misunderstanding was, that 
$GLOBALS['TSFE']->page['title'] is an completely different context 
compared to {data.title}.

Kind regards, Jan




More information about the TYPO3-project-typo3v4mvc mailing list