Reputation: 552
I want to add the current news article title to my breadcrumb navigation. Following is my output:
URL:
Default (German)
index.phpid=19&
L=0&
tx_news_pi1%5Bnews%5D=1&
tx_news_pi1%5Bcontroller%5D=News&
tx_news_pi1%5Baction%5D=detail&
cHash=b182adf919054989c8d640e1da19f0a2
English
index.php?id=19&
tx_news_pi1%5Bnews%5D=1&
tx_news_pi1%5Bcontroller%5D=News&
tx_news_pi1%5Baction%5D=detail&
L=1&
cHash=b182adf919054989c8d640e1da19f0a2
French
index.phpid=19&
L=2&
tx_news_pi1%5Bnews%5D=1&
tx_news_pi1%5Bcontroller%5D=News&
tx_news_pi1%5Baction%5D=detail&
cHash=b182adf919054989c8d640e1da19f0a2
As you can see the last part in my breadcrumb navigation won't get translated. Following my TypoScript for the news title output.
[globalVar = GP:tx_news_pi1|news > 0]
lib.nav_breadcrumb.20 = RECORDS
lib.nav_breadcrumb.20 {
tables = tx_news_domain_model_news
dontCheckPid = 1
source {
data = GP:tx_news_pi1|news
intval = 1
}
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news.field = title
conf.tx_news_domain_model_news.htmlSpecialChars = 1
wrap = <li class="breadcrumb-item active">|</li>
}
[global]
This now fetches the title from the news records. But only from the main language. How can I fetch the other languages?
My System:
Upvotes: 0
Views: 864
Reputation: 552
I had to activate sys_language_overlay. And now everything works
config.sys_language_overlay = 1
Upvotes: 1
Reputation: 10791
Instead of RECORDS
you should use CONTENT
where you have more options to select the records you want.
With CONTENT
you can change the query to select the record which has that sys_language_uid
you want to show, of course you need to select l10n_parent
instead of uid
for languages other than default:
use a TS condition or stdwrap.if
to build two kinds of selections.
Upvotes: 1