[TYPO3-dev] RealURL and switchablecontrolleractions

Felipe Rodriguez felipe at netnnet.de
Thu Oct 8 18:24:47 CEST 2015


Can somebody please help me with the following problem?

I have a plugin called 'detail' in the following page: example.com/detail.html
The plugin has two actions: 
  1) the action 'show' for the controller 'Post' 
  2) the action 'show' for the controller 'Author'
I achieved this by using the switchablecontrolleractions command.

At the moment the urls look like this (for simplicity I omit the chash):
example.com/detail.html?tx_blog_detail[post]=1&tx_blog_detail[action]=show&tx_blog_detail[controller]=Post
example.com/detail.html?tx_blog_detail[author]=2&tx_blog_detail[action]=show&tx_blog_detail[controller]=Author

I want to use realURL to transfrom these urls into:
example.com/detail/Post/name_of_post_with_uid_1.html
example.com/detail/Author/name_of_author_with_uid_2.html

My plan is to use fixedPostVars to handle the tx_blog_detail[controller] section of the URL and use the trick described here (typo3blogger.de/controller-action-switch-durch-get-paramter/) to hide the tx_blog_detail[action] section. Additionally I would use lookUpTable to transform the tx_blog_detail[post] or tx_blog_detail[author] sections into readable names.

So far so good... the problem comes because realURL should be able to encode/decode the name of the post/author depending on whether the controller is Author or Post. Then I thought that I could use userFunc instead of lookUpTable and rewrite the code of lookUpTable in a way that takes into account the previos URL section and put this code into my own custom function. But this is plan is getting mesy and complicated, and I'm not even sure how to begin. 

Does anybody see a better solution? Is it even possible to do? I hope I made the problem clear. Thanks for your help!!



More information about the TYPO3-dev mailing list