[TYPO3-mvc] Cascading ViewHelper

Tim Schoch | GSTALTIG tim.schoch at gstaltig.ch
Wed Jan 12 13:15:14 CET 2011


Hello List

It's me again with another question conserning fluid's inline notation. My problem: I would like to pass the return of the translate ViewHelper as the date format to the format.date ViewHelper, but this doesn't work.
  {f:format.date(date: filter.end, format:'d.m.Y')} = 10.01.2001
    {f:translate(key:'format.date')} = d.m.Y

I've tried several possibilities:
  {f:format.date(date:filter.end,format:f:translate(key:'format.date'))}
  {f:format.date(date:filter.end,format:{f:translate(key:'format.date')})}
  {f:format.date(date:filter.end,format:'{f:translate(key:'format.date')}')}
These all do nothing and will output the exact same string. 

But, interesting enough, the following will fetch the translation (format won't work though)
{f:format.date(date:filter.end,format:\{f:translate(key:'format.date')}\)}
=> {f:format.date(date:filter.end,format:\d.m.Y\)}

{f:format.date(date:filter.end,format:\'{f:translate(key:'format.date')}\')}
=> {f:format.date(date:filter.end,format:\'d.m.Y\')}         

I found the position of the the \ to be interesting: they are wraped around the ViewHelper \{f:translate}\ instead of \{f:translate\} what I would have expceted.

Probably I overlooked something, is there a way to achieve this?

Cheers Tim

ps: Sorry that I didn't respond to my other posts. I had the list turned off in my settings and don't know how to answer to posts that are not mailed to me =/


More information about the TYPO3-project-typo3v4mvc mailing list