typo3 realurl: define default controller and action

I created an extbase extension to display a list of articles on a certain page (pageUid = 24). Before realurl, the url looked like this:
http://www.domain.com/artikelsammlung/haushalt.html?tx_somethingarticles_categorydetail[articleCategory]=101&tx_somethingarticles_categorydetail[action]=showByArticleCategory&tx_somethingarticles_categorydetail[controller]=Article

What I wanted to achieve: http://www.domain.com/artikelsammlung/haushalt/ARTIKELNAME.html My realurl_conf.php looks like this:

'fixedPostVars' => array(
	'artikelhaushaltConfiguration' => array(
		array(
			'GETvar' => 'tx_somethingarticles_categorydetail[controller]',
			'noMatch' => 'bypass'
		),
		array(
			'GETvar' => 'tx_somethingarticles_categorydetail[action]',
			'noMatch' => 'bypass'
		),
		array(
			'GETvar' => 'tx_somethingarticles_categorydetail[articleCategory]',
			'lookUpTable' => array(
				...
			)
		),
	),
	24 => 'artikelhaushaltConfiguration'
),

and additionally there is a typoscript:


[globalVar = GP:tx_somethingarticles_categorydetail|articleCategory > 0]
config.defaultGetVars {
    tx_somethingarticles_categorydetail.action = showByArticleCategory
    tx_somethingarticles_categorydetail.controller = Article
}
[global]

And with that, it works!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.