[TYPO3-mvc] RealURL with extBase

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 21 11:58:23 CET 2010


Hi

> It would be super easy to do something like this with RealURL:
>
> /pageintypo3wheremypluginis/controller/blog/action/show/blogname/my-blog-name/
...
> I'm not really satisfied with this solution because a url for my domain
> would end up being:
>
> /recipes/controller/recipe/action/show/recipe/meatballs-with-gravy/
>
> That's ugly and too long! :)  /recipe/ shows up more than once and
> /controller/action/ shouldn't be necessary.
>
> In a perfect world, I'd have pretty urls like this:
>
> /recipes/show/meatballs-with-gravy/
> /recipes/dishes/main-course/
> /recipes/dishes/
...
> Anyone else given this much thought?  What are you doing in your extensions?

How about using one of realUrls hooks to process the generated URLs by 
hand? You might be able to remove the controller and action completely 
from your urls depending on what other parameters are set. So if a 
"blog" id is given and nothing else, it's most likely the blog 
controller and the index action. If you've got a blog and a post id, 
it's most likely the post controller and the index action etc.. And if 
your URL is ending with 'edit' or 'create' then it's not the index 
action of the according controller, but some other. So I think by 
manually processing the URL generation in realUrl you will get even 
nicer URLs as for any regular v4 extension using default realUrl 
possibilities.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list