Skins

How can I get one blog to display using two or more different skins?

Scenario:
"I want my visitors to be able to see the same blog with more than one skin, but I can only set one blog skin in my blog settings. Can this be done?"

Solution:
Use the method outlined in the FAQ article "Can I force a blog to always use a certain skin?" to create a new copy of index.php for each different skin you want to apply to your blog.

Original forum thread (thanks, ftruscot and vinhboy!):
http://forum.nucleuscms.org/viewtopic.php?t=15262

Example:
If you have a blog called myblog and you want your visitors to be able to see it using the skins Default, Leaf and Slick, create 3 files which are something like this:

index.php
This will display the skin set in your blog settings. In this example, this is the default skin. Notice how we don't need to include the selectSkin('skinname'); line, as Nucleus already knows which skin to use.

<?php
 
$CONF['Self'] = 'index.php';
 
include('./config.php');
 
selectBlog('myblog');
selector();
 
?>

index-leaf.php
Displays the blog "myblog" using the Leaf skin.

<?php
 
$CONF['Self'] = 'index.php';
 
include('./config.php');
 
selectBlog('myblog');
selectSkin('leaf');
selector();
 
?>

index-slick.php
Displays the blog "myblog" using the Slick skin.

<?php
 
$CONF['Self'] = 'index.php';
 
include('./config.php');
 
selectBlog('myblog');
selectSkin('slick');
selector();
 
?>
section: Skins | submitted by Leng on 2007.Mar.10 | 1970 views

item rate
Total votes: 5 - Rating: 7.60

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10