[TYPO3] GETvars with redundant arguments in RealURL fixedPostVars

Dmitry Dulepov [typo3] dmitry at typo3.org
Thu Jul 17 13:40:21 CEST 2008


Hi!

Steffen Müller wrote:
> we use a tagcloud (vge_tagcloud) with tags generated by keywords from 
> tt_news and pages. The tags link to a results page (id=123) which has 
> two FE plugins, one to render the list of pages (tx_vgetagcloud_pi2), 
> the other for the list of news (tx_ttnews_pi SEARCH).
> 
> Tags have links with the following pattern:
> 
> http://foo.bar/?id=123&tx_vgetagcloud_pi2[keyword]=EXAMPLE&tx_vgetagcloud_pi2[pages]=3_44&tx_ttnews[swords]=EXAMPLE 
> 
> 
> In RealURL we use fixedPostVars for the results page:
> 
> 'fixedPostVars' => array(
>   '123' => array(
>     array (
>       'GETvar' => 'tx_vgetagcloud_pi2[keyword]',
>     ),
>     array (
>       'GETvar' => 'tx_vgetagcloud_pi2[pages]',
>     ),
>     array (
>       'GETvar' => 'tx_ttnews[swords]',
>     ),
>   ),
> ),
> 
> This renders the above link to:
> http://foo.bar/topics/EXAMPLE/3_44/EXAMPLE/
> 
> You see, the keyword is used two times, one time for tt_news and one for 
> vge_tagcloud.
> Is there a solution in RealURL to get rid of this redundancy? Is GETvar 
> somehow able to process one argument to several vars?
> Or is there another way to solve this?

RealURL cannot. But I think you can do it with mod_rewrite! I did not test anything below and most likely it will not work if pasted as is but it should give you the idea:

RewriteCond %{REQUEST_URI} ^/topics/([^/]+)/([^/]+)/$
RewriteRule .* /topics/%1/%2/%1/ [L]

This repeats the first segment once more.

You will need to generate a link without the second segment and add a bypass to the last fixedPostVar. Bypass will not encode it if it is empty, so you should get a shorter URL.

-- 
Dmitry Dulepov
TYPO3 Core team
More about TYPO3: http://typo3bloke.net/
Subscribe: http://typo3bloke.net/rss.xml
Latest article: http://typo3bloke.net/post-details/how_to_fill_realurl_cache/


More information about the TYPO3-english mailing list