Latest Template

April Template
Home FAQ Template Chooser FAQ How can I change the template with a link?

How can I change the template with a link?

How can I change the template with a link?

There is no easy way to change your template with a link, but it is possible with a modified version of the Template Chooser. This is how you can do this:

 

- Install the Template Chooser module and plugin and make sure they're both published.

 

- You need the Template Chooser module to be published on your page. If you do not want to see the module, you can remove everything from the file mod_templatechooser/tmpl/default.php. This way you won't see anything from the module on your page, but it will still be there to change the template for you.

 

- Make a change in the file mod_templatechooser/mod_templatechooser.php. Change following lines:

if (isset( $_POST["mod_change_template_".$chooserID])) {
modTemplateChooserHelper::setTemplate($_POST["mod_change_template_".$chooserID], $keep_cookie);
} else {
if (($keep_cookie == 1)&&(isset($_COOKIE["joomla_template"]))&&
($cur_template != $_COOKIE["joomla_template"])) {
$cookietemplate = $_COOKIE["joomla_template"];
modTemplateChooserHelper::setTemplate($cookietemplate, $keep_cookie);
}
}

to

if (isset($_GET["mod_change_template_".$chooserID])) {

if ($cur_template !=$_GET["mod_change_template_".$chooserID])
modTemplateChooserHelper::setTemplate($_GET["mod_change_template_".$chooserID], $keep_cookie);
}
else if (isset( $_POST["mod_change_template_".$chooserID])) {
modTemplateChooserHelper::setTemplate($_POST["mod_change_template_".$chooserID], $keep_cookie);
} else {
if (($keep_cookie == 1)&&(isset($_COOKIE["joomla_template"]))&&
($cur_template != $_COOKIE["joomla_template"])) {
$cookietemplate = $_COOKIE["joomla_template"];
modTemplateChooserHelper::setTemplate($cookietemplate, $keep_cookie);
}
}

- you need to know the ID of your module, you can see this in your back-end. Now you can change the template with a link like this:
index.php?mod_change_template_68=name_of_template.

This name of the template is the same name is the one you see in the backend of the Template Chooser module. The number 68 has to be replaced with the ID of your module.

 

That should do the trick.

Fernstudium und Weiterbildung Trade Shows VIBOS Abendgymnasium Your ad here