[TYPO3-50-general] RFC: Improved Shorthand Syntax

Bastian Waidelich bastian at typo3.org
Tue Oct 27 17:29:38 CET 2009

Hello all,

as some of you might have noticed, with the implementation of the new 
inline notation* we introduced a breaking change and something like
{f:format.crop('static string' maxChars=30)}
is not possible anymore, cause we currently do not allow to process 
static strings with the new syntax.

You could of course use the tag syntax (<f:format.crop 
maxChars="30">static string</f:format.crop>) but that's not really 

I've discussed this with Karsten and we thought about rewriting the 
affected view helpers by adding a new attribute "value", so that you 
could _either_ use the child nodes _or_  explicitly specify the value:

<f:format.crop maxChars="30">static string</f:format.crop>
<f:format.crop value="static string" maxChars="30" />
{f:format.crop(value: 'static string', maxChars: 30)}

But after thinking about it again, I'd prefer to slightly modify the 
Fluid template parser and allow following syntax:

{'static string' -> f:format.crop(maxChars: 30)}

Some view helpers might still need a rewrite. E.g.
{'css/styles.css' -> f:uri.resource()}
looks strange and should be changed to
{f:uri.resource(path: 'css/styles.css')}

But AFAIK that's already changed in trunk of v5.

The bug report with a list of all affected view helpers: 

What do you think?


* we decided to call it "inline notation" (see 
http://forge.typo3.org/issues/show/3295) and I still prefer this over 
"shorthand syntax"

More information about the TYPO3-project-5_0-general mailing list