Hello! Thanks for taking care of this!
My default language is English.
My config.php:
<?php
return [
'debug' => true,
'languages' => true,
'languages.detect' => false,
'omz13.xmlsitemap.cacheTTL' => 0,
'omz13.xmlsitemap.disableImages' => true,
'omz13.xmlsitemap.includeUnlistedWhenSlugIs' => ['home', 'talks', 'teaching', 'publications', 'contact', 'motivation', 'projects', 'press', 'projects'],
'omz13.xmlsitemap.includeUnlistedWhenTemplateIs' => ['project', '', '', '' ],
'omz13.xmlsitemap.excludePageWhenTemplateIs' => [ 'talk','publication','press_coverage' ],
'omz13.xmlsitemap.excludePageWhenSlugIs' => [ 'form' ],
'omz13.xmlsitemap.excludeChildrenWhenTemplateIs' => [ '' ],
];
Here is my complete index.php (covering several of those keyword domains):
<?php
require __DIR__ . '/kirby/bootstrap.php';
function domaincheck($domain) {
$url = rtrim(strtolower((new Kirby)->request()->url()),"/");
if (
($url == "http://localhost/fabianhemmert.com/$domain") ||
($url == "http://$domain") ||
($url == "https://$domain") ||
($url == "http://www.$domain") ||
($url == "https://www.$domain")
) {
return true;
} else {
return false;
}
}
if (domaincheck('experte-digitalisierung.de')) {
c::set('customtitle',"Experte für Digitalisierung");
echo (new Kirby)->render('keyword-domains/experte-digitalisierung-de');
} elseif (domaincheck('experte-innovation.de')) {
c::set('customtitle',"Experte für Innovation");
echo (new Kirby)->render('keyword-domains/experte-innovation-de');
} elseif (domaincheck('keynote-speaker-digitalisierung.de')) {
c::set('customtitle',"Keynote Speaker zum Thema »Digitalisierung«");
echo (new Kirby)->render('keyword-domains/keynote-speaker-digitalisierung-de');
} elseif (domaincheck('keynote-speaker-innovation.de')) {
c::set('customtitle',"Keynote Speaker zum Thema »Innovation«");
echo (new Kirby)->render('keyword-domains/keynote-speaker-innovation-de');
} elseif (domaincheck('redner-digitalisierung.net')) {
c::set('customtitle',"Redner zum Thema »Digitalisierung«");
echo (new Kirby)->render('keyword-domains/redner-digitalisierung-net');
} elseif (domaincheck('redner-innovation.org')) {
c::set('customtitle',"Redner zum Thema »Innovation«");
echo (new Kirby)->render('keyword-domains/redner-innovation-org');
} elseif (domaincheck('vortrag-innovation.com')) {
c::set('customtitle',"Vortrag »Innovation«");
echo (new Kirby)->render('keyword-domains/vortrag-innovation-com');
} elseif (domaincheck('vortrag-digitalisierung.com')) {
c::set('customtitle',"Vortrag »Digitalisierung«");
echo (new Kirby)->render('keyword-domains/vortrag-digitalisierung-com');
} elseif (domaincheck('vortrag-kreativitaet.de')) {
c::set('customtitle',"Vortrag »Kreativität«");
echo (new Kirby)->render('keyword-domains/vortrag-kreativitaet-de');
} else {
echo (new Kirby)->render();
}
Here is my language config:
de.php:
<?php
return [
'code' => 'de',
'default' => false,
'direction' => 'ltr',
'locale' => [
'de_DE'
],
'name' => 'Deutsch',
'url' => 'https://www.fabianhemmert.de',
];
en.php:
<?php
return [
'code' => 'en',
'default' => true,
'direction' => 'ltr',
'locale' => 'en_US',
'name' => 'English',
'url' => 'https://www.fabianhemmert.com'
];
// 'url' => 'https://example.com'
?>
The keyword domain subpages, like this one
https://www.fabianhemmert.com/keyword-domains/vortrag-digitalisierung-com
(which I want to serve directly under the keyword domains) are in German language only, but I duplicated them to exist also in English (hard-coding a “de” lang-code into the header for those pages).
Again, thanks for your help!