[TYPO3-english] realurl: Empty path segments caused of a userFunc - What is the mistake?
Hauke Hain
newgrp at googlemail.com
Sun Jun 19 11:08:46 CEST 2011
Hi there,
for a long time I was not able to update realurl without getting empty path
segments directly underneath my root page. This behaviour was introduced
with realurl 1.10 and now with the current realurl version 1.11.2 ist works
like with 1.9.4 again (no empty path segments are shown).
I used the new setting "emptySegmentValue" to find out if the empty segments
are only not shown to the user. I was right: two empty segments right after
the language parameter.
I found out that the emty segments are created by my own function, called
here in the configuration of the preVars:
array(
'GETvar' => 'L',
'userFunc' =>
'fileadmin/ext/class.tx_realurl_setLanguageParameter.php:&tx_realurl_setLanguageParameter->main',
'valueMap' => array(
'de' => '0',
'en' => '1',
'id' => '2',
),
'valueDefault' => 'de',
),
The goal of the userFunc is to force a L parameter. If none is set the
defaultValue (hardcoded) is set: 'de'
I want to do that to prevent dublicated content. (Previously googles
Webmastertools warned me. Now, after a year of using this function the
warnings are all gone.) It works fine. Nevertheless it creates two empty
path segments and I do not know why.
This is the code:
<?php
class tx_realurl_setLanguageParameter {
function main($conf, $params) {
if (!(($conf['value'] == de) || ($conf['origValue']=='de'))) {
array_unshift($conf['pathParts'],'de',$conf['value']);
}
return $conf['value'];
}
}
?>
Help is appreciated. Thanks in advance for any tip / advice.
Kind regards,
Hauke
More information about the TYPO3-english
mailing list