I'm using TYP 4.5.5, RealURL 1.11.2 and tt_news 3.0.1. I want that the user can switch the language and the corresponding news is shown in the users language. All should work with RealURL.
When switching language the news id is not submitted. So I have to explicitely submit the id. I found some threads which showed me how it could work, but I didn't get it managed. Here is my TS:
lib.tslangmenu = COA
lib.tslangmenu {
10 = HTML
10.value(
<img src="fileadmin/templates/images/languages_en.png" width="48" height="121" alt="Languages" />
<div id="LanguageContents">
)
20 = HMENU
20.special = language
20.wrap = <div id="AvailableLanguages">|</div>
20.special.value = 0,1
20.1 = GMENU
20.1.NO {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.png || fileadmin/templates/images/englisch.png
additionalParams.cObject = COA
additionalParams.cObject {
5 = TEXT
5.wrap = &L=1
10 = TEXT
10.data = GPvar : tx_ttnews | backPid
10.wrap = &tx_ttnews[backPid]=|
10.required = 1
20 = TEXT
20.data = GPvar : tx_ttnews | tt_news
20.wrap = &tx_tt_news[tt_news]=|
20.required = 1
30 = TEXT
30.data = GPvar : cHash
30.wrap = &cHash=|
30.required = 1
}
}
30 = HTML
30.value(
<img class="languagebutton" src="fileadmin/templates/images/languages_en.png" width="48" height="121" alt="Languages" />
</div>
)
According to the information I found I should use additionalParams and set the parameter with GPVar. But I always get the no news_id given message.
Here is my RealURL Config:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT' => array (
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array (
'0' => array (
'GETvar' => 'no_cache',
'valueMap' => array (
'nc' => '1',
),
'noMatch' => 'bypass'
),
'1' => array (
'GETvar' => 'L',
'valueMap' => array (
'de' => '0',
'en' => '1',
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
'2' => array (
'GETvar' => 'lang',
'valueMap' => array (
'de' => 'de',
'en' => 'en',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '7',
'rootpage_id' => '1',
),
'fixedPostVars' => array (
),
'postVarSets' => array (
'_DEFAULT' => array (
'archive' => array (
'0' => array (
'GETvar' => 'tx_ttnews[year]',
),
'1' => array (
'GETvar' => 'tx_ttnews[month]',
'valueMap' => array (
'january' => '01',
'february' => '02',
'march' => '03',
'april' => '04',
'may' => '05',
'june' => '06',
'july' => '07',
'august' => '08',
'september' => '09',
'october' => '10',
'november' => '11',
'december' => '12',
),
),
),
'browse' => array (
'0' => array (
'GETvar' => 'tx_ttnews[pointer]',
),
),
'select_category' => array (
'0' => array (
'GETvar' => 'tx_ttnews[cat]',
),
),
'article' => array(
array(
'GETvar' => 'tx_ttnews[pointer]',
'valueMap' => array(),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_ttnews[tt_news]',
'lookUpTable' => array(
'table' => 'tt_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
array (
'GETvar' => 'tx_ttnews[swords]',
),
),
),
),
Solution:
Seems that adding addQueryString does the job. Here is my final language switcher:
lib.tslangmenu = COA
lib.tslangmenu {
10 = HTML
10.value(
<img src="fileadmin/templates/images/languages.png" width="48" height="121" alt="Sprachen" />
<div id="LanguageContents">
)
20 = HMENU
20.special = language
20.wrap = <div id="AvailableLanguages">|</div>
20.special.value = 0,1
20.addQueryString = 1
20.1 = GMENU
20.1.NO {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.png || fileadmin/templates/images/englisch.png || fileadmin/templates/images/kroatisch.png
}
20.1.ACT < 20.1.NO
20.1.ACT = 1
20.1.ACT.wrap =<span class="langhide">|</span>
20.1.ACT {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.png || fileadmin/templates/images/englisch.png || fileadmin/templates/images/kroatisch.png
}
20.1.CUR < 20.1.ACT
20.1.CUR = 1
20.1.CUR{
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.png || fileadmin/templates/images/englisch.png || fileadmin/templates/images/kroatisch.png
}
30 = HTML
30.value(
<img class="languagebutton" src="fileadmin/templates/images/languages.png" width="48" height="121" alt="Sprachen" />
</div>
)
}
Take a look at the following properties for your menu:
protectLvar
addQueryString <--- keeps the params to the string when switching languages.
TSREF is your friend:
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.6.0/view/1/7/#id2635691
Your TypoScript has some errors:
20.wrap = &tx_tt_news[tt_news]=|
Remove tthe underscore:
20.wrap = &tx_ttnews[tt_news]=|
And do not set cHash by hand! 30.wrap = &cHash=| It will prevent your page from being cached, because the cHash will be wrong!
Related
My realurl.conf contains the following:
'2' => array (
'GETvar' => 'L',
'valueMap' => array (
'en' => '1',
'nl' => '2',
'be-nl' => '3
'be-fr' => '4'
),
'noMatch' => 'bypass',
),
and:
array(
'GETvar' => 'L',
'value' => '3',
'urlPrepend' => 'http://www.example.be',
'useConfiguration' => 'www.example.be',
),
array(
'GETvar' => 'L',
'value' => '4',
'urlPrepend' => 'http://www.example.be/fr',
'useConfiguration' => 'www.example.be/fr',
),
and:
[globalVar= GP:L=4]
//french (Belgium) = 4
config{
sys_language_uid = 4
language = fr
htmlTag_setParams = lang="fr"
locale_all = fr_FR.UTF-8
sys_language_mode = content_fallback;4,8
}
page.bodyTagCObject.30.value = fr
[global]
In T3 backend the url "www.example.be/fr" is configured properly and content is there for the specific languages.
When I go to www.example.be/fr, I get the L-parameter 3 and the content for the language id 3. Could anyone help me out on this?
I'm using TYPO3 7.6 with a multidomain and multilanguage Website, you see the links below. I've one page tree and rootpage_id for all three languages!
First language is german (L=0, https://www.renosan.de/)
Second language is english (L=1, https://www.renosan.net/)
Third language is polish (L=2, https://www.renosan.pl/)
For every language I'm using an own top-level domain (de,net,pl). I've also insert the domain records at my root page (TYPO3-Backend List -> Rootpage -> Domain records)
If I'm clicking at the preview button (s. image), the preview opens in a new window with:
English: https://www.renosan.de/index.php?id=1&L=1
Polish: https://www.renosan.de/index.php?id=1&L=2
... but the content is still in the default language (german)! I need to change the TLD to change the Website language manually. It's not useful for my editors, because they aren't seeing the preview with one click.
Can someone explain the behaviour from TYPO3?
I also tried to login into Backend from .net or .pl, nothing happens. It's always the default preview. No special .htaccess entries ...
My TypoScript Setup
### default german
config {
linkVars = L(0-2)
uniqueLinkVars = 1
sys_language_mode = content_fallback
sys_language_overlay = hideNonTranslated
sys_language_uid = 0
language = de
locale_all = de_DE.UTF8
htmlTag_langKey = de
}
### english L=1
[globalString = IENV:HTTP_HOST = *renosan.net]
config {
baseURL = https://www.renosan.net/
sys_language_uid = 1
language = en
locale_all = en_GB.UTF8
htmlTag_langKey = en
}
[GLOBAL]
### polski L=2
[globalString = IENV:HTTP_HOST = *renosan.pl]
config {
baseURL = https://www.renosan.pl/
sys_language_uid = 2
language = pl
locale_all = pl_PL.UTF8
htmlTag_langKey = pl
}
[GLOBAL]
I have locate the problem with my individual realURL-conf. If I try it with the 'autoconf' from Ext:realURLthe preview from Backend works!
Here's my personal realURL-Configuration file:
<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => 1,
'firstHitPathCache'=> 1
),
'init' => array(
'enableCHashCache' => 1,
'respectSimulateStaticURLs' => 0,
'postVarSet_failureMode' => '',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
//'de' => '0',
'en' => '1',
'pl' => '2'
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
'42' => 'newsDetailConfiguration',
'43' => 'newsDetailConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass',
),
),
'tags' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array (
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => 'AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
'seite' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
// news archive parameters
'archiv' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
'valueMap' => array(
'january' => '01',
'february' => '02',
'march' => '03',
'april' => '04',
'may' => '05',
'june' => '06',
'july' => '07',
'august' => '08',
'september' => '09',
'october' => '10',
'november' => '11',
'december' => '12',
),
),
),
),
),
);
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DOMAINS'] = array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => '0',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.de'
),
array(
'GETvar' => 'L',
'value' => '1',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.net'
),
[
'GETvar' => 'L',
'value' => '2',
'useConfiguration' => 'renosan.de',
'urlPrepend' => 'https://www.renosan.pl'
],
),
'decode' => array(
'renosan.de' => array(
'GETvars' => array(
'L' => '0',
),
'useConfiguration' => 'renosan.de'
),
'renosan.net' => array(
'GETvars' => array(
'L' => '1',
),
'useConfiguration' => 'renosan.de'
),
'renosan.pl' => array(
'GETvars' => array(
'L' => '2',
),
'useConfiguration' => 'renosan.de'
),
)
);
?>
Thanks for your help .. I have still no solution for this TYPO3-Problem?! Is it a TYPO3-Bug? Is there a problem with my realURL-Configuration-File?
I think your conditions are wrong and TYPO3 gets so confused that the conditions are ignored completely.
it is not
[global string = ENV: HTTP_HOST = ...
but:
[globalString = ENV:HTTP_HOST = ...
On the other hand I assume your TYPO3 will also gets confused about domains and additional language parameter. For preview you need to be logged in into the BE (cookies are domain dependend). So a preview in another language is possible only with language parameter. Your configuration mixes domains and language parameter: if you start with www.renosan.de?L=1 your baseurl is changed.
My recommandation: Split the handling depending on domain and L-Param.
If you use RealURL: Look at this blog post. Here you can see how to config realURL to watch at the Domains to seperate languages.
After that, you dont need conditions about the domains. You can use the simple [globalVar = GP:L = x] conditions.
The realurl config with tx_news works fine for me, but I have one problem. I dont need the detail-name in the address.
www.domain.org/news-list/news-detail/test-news-name-here/
and now i dont need the "news-detail".
Here the PHP code realurl.php
<?php
$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => 1,
'firstHitPathCache'=>1
),
'init' => array(
'enableCHashCache' => TRUE,
'enableCHashCache' => 1,
'respectSimulateStaticURLs' => 0,
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
//'de' => '0',
//'en' => '1',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fileName' => array(
'index' => array(
'sitemap.xml' => array(
'keyValues' => array(
'type' => 1234,
),
),
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
'6' => 'newsDetailConfiguration',
// For additional detail pages, add their uid as well
//'13' => 'newsDetailConfiguration',
//'22' => 'newsDetailConfiguration',
//'4' => 'newsTagConfiguration',
//'4' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass',
),
),
'stadt' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
'tags' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array (
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => 'AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
'seite' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
// news archive parameters
'archiv' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
'valueMap' => array(
'january' => '01',
'february' => '02',
'march' => '03',
'april' => '04',
'may' => '05',
'june' => '06',
'july' => '07',
'august' => '08',
'september' => '09',
'october' => '10',
'november' => '11',
'december' => '12',
),
),
),
),
),
// configure filenames for different pagetypes
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
),
);
?>
I need that typoscript?
plugin.tx_news {
settings {
link {
skipControllerAndAction = 1
}
}
}
In the Detail-Page I check the realurl:
tx_realurl_exclude = 1
You can use detail & list plugin on the same page. Check this url: https://forge.typo3.org/issues/50489
lib.news = USER
lib.news {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = News
controller = News
settings =< plugin.tx_news.settings
persistence =< plugin.tx_news.persistence
view =< plugin.tx_news.view
}
lib.news_list< lib.news
lib.news_list {
action = list
switchableControllerActions.News.1 = list
}
lib.news_detail < lib.news
lib.news_detail {
action = detail
switchableControllerActions.News.1 = detail
}
[globalVar = GP:tx_news_pi1|news > 0]
lib.field_news_single < lib.news_detail
[else]
lib.field_news_list < lib.news_list
[end]
Answer: it is not possible to exclude the current (=last) page from speaking URL.
If you are interested in technical details, you can read more in the RealURL's notes for integrators.
Just an additional followup with another solution:
Use a TypoScript condition to render dynamically the detail plugin at the list page.
[globalVar = GP:tx_news_pi1|news > 0]
page.10 >
page.10 < lib.news
[global]
Of course you can do a lot more fancy stuff if you need to render e.g. other content elements as well!
[globalVar = GP:tx_news_pi1|news > 0]
page.10 >
page.10 = CONTENT
page.10 {
table = tt_content
pidInList = <page ID of your detail page>
orderBy = sorting
}
[global]
This will render you all content elements of the detail page on the list page.
If you want to have list and single view on separate pages then extension singleview at https://github.com/sourcebroker/singleview does exactly what you want.
This extension uses TYPO3 build in feature "Show content from pid" which you can find in page properties. In this extension value for "Show content from pid" field is set dynamically based on $_GET parameter. When TYPO3 renders page with list view then ext:singleview checks if $_GET parameter has single view request. If this is true then it sets "content_from_pid" field with value of single view page uid. This way single view page with its content and layout is shown on list view page.
For TYPO3 7.6 use ext:singlenews version 1.3.
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
),
),
);
You need to tell TYPO3 to keep the parameters.
This is done by configuring addQueryString in the HMENU ConentObject.
Your example would be extended by:
temp.breadcrumbNav=COA
temp.breadcrumbNav {
10 = HMENU
10 {
1 {
NO {
addQueryString.exclude = L,cHash
}
}
}
}
For further information check the documentation:
docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Hmenu/Index.html and docs.typo3.org/typo3cms/TyposcriptReference/Functions/Typolink/Index.html
And the solution above can be found on forge: https://forge.typo3.org/issues/16466#note-3
I'm runnning Typo3 6.2.4 with RealURL 1.12.8 and News (tx_news) 3.0.1. Using the automatic configuration from RealURL rewrites the URLs for "normal" pages, but not for news. The generated links look like this:
index.php?id=5&tx_news_pi1%5Bnews%5D=4&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&cHash=706379a0ef43d4020448c5193f865bf1
This is what automatic configuration gives me. I've just inserted the part from http://docs.typo3.org/typo3cms/extensions/news/Main/Administration/Realurl/Index.html. At the moment I'm not interested in creating a special kind of rewritten URL, I just want to get RealURL rewrite the news URLs. Once that's running, I think I'll get the rest figured out.
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'_DEFAULT' =>
array (
'init' =>
array (
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
),
'pagePath' =>
array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'rootpage_id' => '1',
),
'fileName' =>
array (
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' =>
array (
'print' =>
array (
'keyValues' =>
array (
'type' => 98,
),
),
),
),
'postVarSets' =>
array (
'_DEFAULT' =>
array (
// EXT:news start
'news' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
// EXT:news end
),
),
),
);
It turned out that my realurl_conf.php was correct, but the TypoScript configuration part was missing. As soon as I put those lines in the template setup of my root page, Typo3 started to rewrite the URLs:
config.absRefPrefix = /
config.tx_realurl_enable = 1
config.uniqueLinkVars = 1
# dont forget to set the allowed range - otherwise anything else could be inserted
config.linkVars = L(0-3)
Source:
http://wiki.typo3.org/Realurl/manual#TypoScript_configuration
http://docs.typo3.org/typo3cms/extensions/realurl/Realurl/Configuration/HandlingRelativeLinksWithSpeakingUrls/Index.html