[TYPO3-english] How to insert additionalparams with more than 2 level for f:link.page

bernd wilke t3ng at bernd-wilke.net
Mon Sep 16 14:30:11 CEST 2013


Am 16.09.13 13:06, schrieb Stephan Schuler:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hey there.
>
>
> I guess the problem is *not* related to hierarchical parameter processing and overruling.
> It's related to general Fluid array syntax, especially the thing where array keys are detected.
>
> You cannot use "special characters" such as "@" as part of array keys in Fluid.
> Try those:
>
>> <f:debug>{widget_0:'{currentPage: \'xxxxx\'}'}</f:debug>
>> <f:debug>{@widget:'{currentPage: \'xxxxx\'}'}</f:debug>
>
> The first will output a properly formatted array, such as "array('widget_0' => array('currentPage' => 'xxx'))".
> The second one creates the flat string instead, since it's no valid array notation in Fluid.
>
> So, you most likely will not be able to use "@widget_*" as link parameters.

which means: you are very much restricted in the the use of indizes to 
URL parameters by fluid :-((((

 >
> Writing those kind of links isn't necessarily unreadable. The only thing that makes it feel a bit clumsy is escaping. Besides that, using some line breaks and indention isn't that ugly.

it's not the readability but the correct working.

>> <f:debug>{
>>      0: 'fooo',
>>      1: 'bar',
>>      foo: '{
>>          key: \'value\',
>>          key2: \'{
>>              key3: \\\'value2\\\'
>>          }\'
>>      }'
>> }</f:debug>

this might make it more readable for humans, but the result will be full 
of whitespace AND #10(LF) in inappropiate positions as this is not 
removed by fluid.
you will find a lot of empty (just whitespace) lines in the newer TYPO3 
generated websites as fluid-templates are used and fluid only removes 
fluid-control-tags but no whitespace/linebreaks around.

>
> Ok, I must admit that using own view helpers that take individual arguments for that is better in terms of usability. It is both, better readable and less error prone since you cannot mistype argument names without Fluid exceptions.
> But using individual view helpers that extend existing ones for each and every one-hit situation usually feels a bit like xclassing of former days. That's useful in some cases, but I would not go using it as golden hammer.
>
> But since you clearly want to have this "@widget_0" argument name here, you might have no other chance.

as I want to use the pagination of tx_news the URL-params are defined by 
tx_news and so the base viewhelpers.
rebuilding all new means ignoring or rewriting tx_news.

on the other hand: why do the pagination use such a strange param which 
is incompatible with fluid syntax ???


> You could try the PaginateViewHelper instead. That one comes with proper link building. This way you could completely avoid accessing the "@widget_*" property, which isn't good ad all because you cannot rely on having "_0" as suffix forever.

on the other page I use the PaginateViewhelper, which works well. but on 
'this' page I need to generate Links to all the paginate-pages which did 
not work.
so I tried to generate the links by hand. and failed again. :(

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list