Change template in Joomla

212 Views Asked by At

I've tried various ways to change template in Joomla 3.9.x like:

$app = JFactory::getApplication();
$params = array();
$app->setTemplate('beez3');

It seems like it's doing a partial switch, but not a "full switch", so I'm ending up with something weird. Does anyone know if setTemplate is deprecated? Or how to fully switch template using PHP.

EDIT: doing some more tests, it looks like it's related to Yootheme Pro, as it works between protostar and beez3 templates, but when Yootheme Pro is default template, the switching become weird as mentioned before. Seems likely due to some plugin.

If I want to switch to a Yootheme Pro template and it's not the default template, I'm getting an error 500 with: JHtml::theme not found. So again, clearly a Yootheme issue.

I need it to switch some specific views from within a component.

0

There are 0 best solutions below