[TYPO3-mvc] advanced realurl for minimal list and show urls

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Feb 17 10:08:38 CET 2011


Hi,

> i have a list action on page "products" (say it has id 9):
> http://site.com/products/
>
> and would like to sow item "myitem" on url
> http://site.com/products/myitem/
>
> configuring reaulr like this:
>
> 'fixedPostVars' => array(
...
> ),
>
> i can get this url:
>
> http://site.com/products/show/myitem/
>
> in no way i can get rid of that "show" (making the show action work)
...
> do you think it's possibile to solve it

depends on how much effort you like to bring up. There might be two 
solutions:

a) move the showAction to a separate page, make it the default action 
and set the page to "exclude form speaking url" (could work, not tested 
though)

b) bypass the controller and action parameters in the URL, hook in to 
TSFE->checkAlternativeIdMethods-PostProc and recreate the getVars on 
demand, depending on the given getVars. That's what I did for a shop 
extension where I had to get nice looking URLs while having up to four 
different IDs in the getVars, each combination belonging to a different 
controller (catalog +> chapter +> category +> product). Probably the 
most tricky thing here is to mess with the cHash (first check if it was 
valid, then modify the getVars and apply a new cHash).
In most cases it's possible to figure out the intended controller by the 
number of getVars you have.
Having a tx_yourext_catalog[product]=1 var in the URI will most likely 
mean that you intend to get the detail view of a product, and having 
different plugin namespaces you could also distinguish f.e. between the 
catalog detail action and a product export/import action.

That's the two approaches I have at hand, but I think Bastian might have 
another one simmilar to a).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list