Ich habe zuerst den TemplateLoader untersucht und bin dann auf die Controller Methode getTemplate gestoßen:
PHP-Code:
/**
* Find a particular template file and return its path
*
* @param string $strTemplate The name of the template
* @param string $strFormat The file extension
*
* @return string The path to the template file
*
* @throws \Exception If $strFormat is unknown
*/
public static function getTemplate($strTemplate, $strFormat='html5')
{
$arrAllowed = trimsplit(',', $GLOBALS['TL_CONFIG']['templateFiles']);
array_push($arrAllowed, 'html5'); // see #3398
if (!in_array($strFormat, $arrAllowed))
{
throw new \Exception("Invalid output format $strFormat");
}
$strTemplate = basename($strTemplate);
// Check for a theme folder
if (TL_MODE == 'FE')
{
global $objPage;
// ###
// ###
// Diese Zeile habe ich hinzugefügt, dann hat er das richtige Template gefunden
$objPage = self::getPageDetails($objPage->id);
// ENDE
// ###
// ###
$strCustom = str_replace('../', '', $objPage->templateGroup);
if ($strCustom != '')
{
return \TemplateLoader::getPath($strTemplate, $strFormat, $strCustom);
}
}
return \TemplateLoader::getPath($strTemplate, $strFormat);
}
Es scheint so, als würde die templateGroup noch nicht an $objPage übergeben worden sein.
Lesezeichen