Saturday, 02 March 2013 23:42

Joolma (1.5) - Editing alternate template on live site based on username

Add these lines to include/application.php
<------><------>// Fallback template
<------><------>if (!file_exists(JPATH_THEMES.DS.$template.DS.'index.php')) {
<------><------><------>$template = 'rhuk_milkyway';
<------><------>}
+//MS allow to work on template with live site
+<------>    $usr=$this->getUser();
+<------>    if ($usr->username=="DEV-USER") $template="NAMEOFNEWTEMPLATE";
<------><------>// Cache the result
<------><------>$this->set('setTemplate', $template);
<------><------>return $template;
<------>}
Last modified on Saturday, 02 March 2013 23:48

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.