[TYPO3-english] RealURL Language Switch for Extbase Extension
Jan Bednarik
info at bednarik.org
Mon Nov 2 22:35:00 CET 2015
Hi,
this is not a matter of RealUrl (or CoolUri), but of the HMENU. With
special=language there's additional property addQueryString available,
see
https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Hmenu/Index.html
Jan
Dne 2. 11. 2015 v 7:32 Bernhard Schenkenfelder napsal(a):
>
> I have set up a single-domain website with different languages and
> configured RealURL.
>
> On one page, there is a FE plugin with list and show actions. The links
> from the list to the show action are rendered correctly, for example:
>
> en/press.html -> en/press/release1.html
> en/press.html -> en/press/release2.html
>
> Clicking on one of the links surfaces the detail page - so far, so good.
> Everything works as expected.
>
> However, the language switch returns the following links (on the detail
> page):
>
> en/press.html
> de/presse.html
>
> The links, of course, should read as follows:
>
> en/press/release1.html
> de/presse/aussendung1.html
>
> Also, the breadcrumb menu does not show the detail page; it reads Home >
> Press, regardless of whether I'm on the list or show action.
>
> Language Nav
>
> temp.langNav = COA
> temp.langNav {
> 10 = HMENU
> 10 {
> special = language
> special.value = 0,1,2,3,4,5,6,7,8
> special.normalWhenNoLanguage = 0
> wrap = <ul class="lang-sel__list">|</ul>
> 1 = TMENU
> 1 {
> noBlur = 1
> NO = 1
> NO {
> allWrap = <li class="lang-sel__item">|</li>
> ATagParams = class="lang-sel__link"
> stdWrap.setCurrent = English || Deutsch || Русский || Česky ||
> Polski || Français || Română || Hrvatski || Slovenčina
> stdWrap.current = 1
> }
>
> USERDEF1 = 1
> USERDEF1 {
> doNotLinkIt = 1
> stdWrap.cObject = TEXT
> stdWrap.cObject.value =
> }
> }
> }
> }
>
> temp.selectedLang = TEXT
> temp.selectedLang.value < config.language
>
> Breadcrumb Nav
>
> temp.breadcrumbNav=COA
> temp.breadcrumbNav {
> 10 = HMENU
> 10 {
> special = rootline
> special.range = 0|-1
> includeNotInMenu = 1
> wrap = |
> 1 = TMENU
> 1.noBlur = 1
> 1.CUR = 1
> 1.wrap = |
> 1.NO {
> stdWrap.field = title
> ATagParams = class="main-header__breadcrumb-link"
> ATagTitle.field = nav_title // title
> linkWrap = <li class="main-header__breadcrumb-item">|</li>
> }
> 1.CUR {
> stdWrap.field = title
> linkWrap = <li class="main-header__breadcrumb-item">|</li>
> doNotLinkIt = 1
> }
> }
> }
>
> RealURL Config
>
> $TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
>
> $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
> '_DEFAULT' => array(
> 'init' => array(
> 'enableCHashCache' => 1,
> 'appendMissingSlash' => 'ifNotFile',
> 'enableUrlDecodeCache' => 1,
> 'enableUrlEncodeCache' => 1,
> 'postVarSet_failureMode' => '',
> ),
> 'redirects' => array(),
> 'preVars' => array(
> array(
> 'GETvar' => 'L',
> 'valueMap' => array(
> 'en' => 0,
> 'de' => 1,
> 'ru' => 2,
> 'cz' => 3,
> 'pl' => 4,
> 'fr' => 5,
> 'ro' => 6,
> 'hr' => 7,
> 'sk' => 8
> ),
> 'valueDefault' => 'en',
> ),
> ),
> 'pagePath' => array(
> 'type' => 'user',
> 'userFunc' =>
> 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
> 'spaceCharacter' => '-',
> 'languageGetVar' => 'L',
> 'expireDays' => 7,
> 'rootpage_id' => 1,
> 'firstHitPathCache' => 1,
> ),
> 'fixedPostVars' => array(
> '_DEFAULT' => array(
> array(
> 'GETvar' => 'press',
> 'lookUpTable' => array(
> 'table' => 'tx_myext_domain_model_press',
> 'id_field' => 'uid',
> 'alias_field' => 'title',
> 'addWhereClause' => ' AND NOT deleted',
> 'useUniqueCache' => 1,
> 'useUniqueCache_conf' => array(
> 'strtolower' => 1,
> 'spaceCharacter' => '-'
> ),
> 'languageGetVar' => 'L',
> 'languageField' => 'sys_language_uid',
> 'transOrigPointerField' => 'l10n_parent',
> )
> )
> ),
> 'fileName' => array(
> 'defaultToHTMLsuffixOnPrev' => 1
> ),
> ),
> );
More information about the TYPO3-english
mailing list