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

Stephan Schuler Stephan.Schuler at netlogix.de
Mon Sep 16 13:06:58 CEST 2013


-----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.

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.

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

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.

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.


Regards,
Stephan.



Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de



- --
netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



- -----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] Im Auftrag von Xavier Perseguers
Gesendet: Montag, 16. September 2013 09:53
An: typo3-english at lists.typo3.org
Betreff: Re: [TYPO3-english] How to insert additionalparams with more than 2 level for f:link.page

HI Bernd,

bernd wilke wrote:
> nobody using fluid to build such complex links?

No. I find this syntax totally unreadable and would prefer creating a dedicated VH taking needed parameters and creating the link. You can then use standard PHP and have something you understand.

Cheers

- --
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 3.3.0 (Build 9307)
Charset: utf-8

wpUDBQFSNuZUpp0IwsibV8MBCJw6A/wMfLqWq8kNcsytw1ijFPJ8m13k8OAf05NY
hn2IneqD/WVIqLOMXck+zdVprF7mlvwlmZq91MsuLWImlGHKyilzbeOmxtUjlF4/
TRIVzHN7EQ+sGADe4yJa2UX9bqnAbyNGXx0A+dt+g2CjL3r1QgJbxh5WWsACDUgN
BAdiUOXqtQ==
=wx0A
-----END PGP SIGNATURE-----


More information about the TYPO3-english mailing list