Die TYPO3 Mailingliste - nicht fragen: lesen!
This is a discussion on [TYPO3] RealURL : moving language part to 2nd position within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; Hello, I wonder if it is possible to ask RealURL to put the language parameter at second position: <root&...
|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Hello,
I wonder if it is possible to ask RealURL to put the language parameter at second position: <root> [page] section1 page1 page2 page3 section2 page4 page5 Instead of having http://domain.tld/fr/section1/page2/page3 I would have to read http://domain.tld/section1/fr/page2/page3 -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Hi!
Xavier Perseguers wrote: > I wonder if it is possible to ask RealURL to put the language parameter > at second position: Not possible by default. preVars always go before the rest of URL. The only possible way is to provide own encoding/decoding function. -- Dmitry Dulepov E-mail: dmitry (AT) typo3 (DOT) org Skype: callto:liels_bugs TYPO3 technical: http://typo3bloke.net/ _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
> I wonder if it is possible to ask RealURL to put the language parameter
> at second position: > > <root> > [page] > section1 > page1 > page2 > page3 > section2 > page4 > page5 > > Instead of having http://domain.tld/fr/section1/page2/page3 I would have > to read http://domain.tld/section1/fr/page2/page3 I think I'll have to XCLASS RealURL to change the way pagePatch encoding/decoding is performed... -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
Hi,
>> I wonder if it is possible to ask RealURL to put the language >> parameter at second position: > > Not possible by default. preVars always go before the rest of URL. The > only possible way is to provide own encoding/decoding function. We got the same idea ![]() -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#5
|
|||
|
|||
|
Hi!
Xavier Perseguers wrote: > I think I'll have to XCLASS RealURL to change the way pagePatch > encoding/decoding is performed... Yes. You need to subclass either tx_realurl, functions where it returns result. Simplest way would be to explode() url, check the first segment and exchange it with the second segment. Then implode all back. Should be easy to do. -- Dmitry Dulepov E-mail: dmitry (AT) typo3 (DOT) org Skype: callto:liels_bugs TYPO3 technical: http://typo3bloke.net/ _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#6
|
|||
|
|||
|
Hi!
>> I think I'll have to XCLASS RealURL to change the way pagePatch >> encoding/decoding is performed... > > Yes. You need to subclass either tx_realurl, functions where it returns > result. Simplest way would be to explode() url, check the first segment > and exchange it with the second segment. Then implode all back. Should > be easy to do. Yes, I thought about something like that. Perhaps I'll have to have a trick for URL with only 1 part but it should be OK. I created my extension as ux_realurl_advanced.php in typo3conf and try to get it called with 'userFunc' => 'typo3conf/class.ux_realurl_advanced.php:&ux_realurl_advanced->main' but it does not work yet, although the file is included. And I do not know whether XCLASSing is relevant. -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#7
|
|||
|
|||
|
Hi!
Xavier Perseguers wrote: > I created my extension as ux_realurl_advanced.php in typo3conf and try > to get it called with > > 'userFunc' => > 'typo3conf/class.ux_realurl_advanced.php:&ux_realurl_advanced->main' > > but it does not work yet, although the file is included. And I do not > know whether XCLASSing is relevant. No, wrong XCLASS call. You never specify XLCASS directly, you only define it and declare it in your ext_localconf.php as: $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/realurl/class.tx_realurl_advanced.php'] = t3lib_extMgm::extPath('yourext') . 'class.ux_tx_realurl_advanced.php'; TYPO3 will do the rest. But you need to XCLASS another class actually tx_realurl_advanced receives a path with all pre/post vars stripped. You need to XCLASS main class.-- Dmitry Dulepov E-mail: dmitry (AT) typo3 (DOT) org Skype: callto:liels_bugs TYPO3 technical: http://typo3bloke.net/ _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#8
|
|||
|
|||
|
Hi!
> No, wrong XCLASS call. You never specify XLCASS directly, you only > define it and declare it in your ext_localconf.php as: > > $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/realurl/class.tx_realurl_advanced.php'] > = t3lib_extMgm::extPath('yourext') . 'class.ux_tx_realurl_advanced.php'; > > TYPO3 will do the rest. > > But you need to XCLASS another class actually tx_realurl_advanced > receives a path with all pre/post vars stripped. You need to XCLASS main > class. OK thanks. I tested it in the train and got it, at least first part ![]() $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/realurl/class.tx_realurl.php'] = PATH_typo3conf . 'class.ux_tx_realurl.php'; <?php class ux_tx_realurl extends tx_realurl { function encodeSpURL(&$params, &$ref) { parent::encodeSpURL($params, $ref); echo 'encode:'; debug($params['LD']['totalURL']); } function decodeSpURL($params, &$ref) { echo 'decode:'; debug($params['LD']['totalURL']); parent::decodeSpURL($params, $ref); } } ?> I just have to play with totalURL as I see... BTW, do you have a config hint to force RealURL to prepend the language prefix when it is not present (= default language)? I'll need this feature and if it is not possible then I'll have to do it in my XCLASS but it seems that I would then have to modify a few arrays... -- Xavier Perseguers http://xavier.perseguers.ch/en _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#9
|
|||
|
|||
|
Hi!
Xavier Perseguers wrote: > BTW, do you have a config hint to force RealURL to prepend the language > prefix when it is not present (= default language)? I'll need this > feature and if it is not possible then I'll have to do it in my XCLASS > but it seems that I would then have to modify a few arrays... Should work if you specify default value for it in RealURl configuration. -- Dmitry Dulepov E-mail: dmitry (AT) typo3 (DOT) org Skype: callto:liels_bugs TYPO3 technical: http://typo3bloke.net/ _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#10
|
|||
|
|||
|
hi xavier
may I knidly aks if you have already developed a working solution for moving the language part to the 2nd position, and if so would you share it with some comments on how o use/install it? thx and rgds GUIDO On 2008-06-24 18:51:59 +0200, Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> said: > Hi! > >> No, wrong XCLASS call. You never specify XLCASS directly, you only >> define it and declare it in your ext_localconf.php as: >> >> $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/realurl/class.tx_realurl_advanced.php'] >> = t3lib_extMgm::extPath('yourext') . 'class.ux_tx_realurl_advanced.php'; >> >> TYPO3 will do the rest. >> >> But you need to XCLASS another class actually tx_realurl_advanced >> receives a path with all pre/post vars stripped. You need to XCLASS >> main class. > > OK thanks. I tested it in the train and got it, at least first part ![]() > > $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/realurl/class.tx_realurl.php'] > = PATH_typo3conf . 'class.ux_tx_realurl.php'; > > <?php > class ux_tx_realurl extends tx_realurl { > function encodeSpURL(&$params, &$ref) { > parent::encodeSpURL($params, $ref); > echo 'encode:'; > debug($params['LD']['totalURL']); > } > > function decodeSpURL($params, &$ref) { > echo 'decode:'; > debug($params['LD']['totalURL']); > parent::decodeSpURL($params, $ref); > } > } > ?> > > I just have to play with totalURL as I see... > > BTW, do you have a config hint to force RealURL to prepend the language > prefix when it is not present (= default language)? I'll need this > feature and if it is not possible then I'll have to do it in my XCLASS > but it seems that I would then have to modify a few arrays... _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Themen-Optionen | Thema durchsuchen |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] Realurl without language prefix? | Lars Axberg | typo3-english@lists.netfielders.de | 1 | 16.05.2008 13:50 |
| [TYPO3] Realurl without language prefix? | Lars Axberg | typo3-english@lists.netfielders.de | 0 | 16.05.2008 12:40 |
| [TYPO3] One-tree multi-language site - one-language realurl | Alexander Maringer | typo3-english@lists.netfielders.de | 3 | 26.03.2008 17:47 |
| [TYPO3] RealURL language dependent domain help | Sara Weale | typo3-english@lists.netfielders.de | 1 | 14.03.2008 17:09 |
| [TYPO3] language menu and realurl (issue with L=0 language) | Ralph Grier | typo3-english@lists.netfielders.de | 3 | 30.09.2007 05:23 |