I would like to assign a specific template for a certain category, I have tried with this code in a plugin system but without success (this code does not include the condition for the category I will do it afterwards.
<?php
defined('_JEXEC') or die;
class templateSwitcherCategory extends JPlugin
{
public function __construct(&$subject, $config)
{
// Calling the parent Constructor
parent::__construct($subject, $config);
// Do some extra initialisation in this constructor if required
}
public function onAfterInitialise()
{
$app = JFactory::getApplication();
$app->setTemplate('protostar', null);
return true;
}
}
?>
Plg<PluginGroup><PluginName>
. See documentation docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla.