typo3 realurl: define default controller and action


February 03, 2015 at 08:58
Typo3

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!

Tags: default controller realurl


Hinterlasse einen Kommentar:
Search