Fix: register template asset manifest in offline page context
Joomla does not auto-load joomla.asset.json for offline.php, causing 'unable to detect manifest' errors. Explicitly register the registry file before using any WAM assets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,12 @@ $wa = $doc->getWebAssetManager();
|
||||
$params = $this->params ?: $app->getTemplate(true)->params;
|
||||
$direction = $this->direction ?: 'ltr';
|
||||
|
||||
// Register the template's asset manifest (not auto-loaded in offline context)
|
||||
$manifestPath = JPATH_ROOT . '/media/templates/site/' . $this->template . '/joomla.asset.json';
|
||||
if (is_file($manifestPath)) {
|
||||
$wa->getRegistry()->addRegistryFile($manifestPath);
|
||||
}
|
||||
|
||||
/* -----------------------
|
||||
Load assets via WebAssetManager (matches index.php pattern)
|
||||
------------------------ */
|
||||
|
||||
Reference in New Issue
Block a user