Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Change The Skin By Vistor Change The Skin By Vistor
Previous
 
Next
New Post
12/16/2008 12:13 PM
 

Hello

Can any one tell me how can my vistors change the Skin without login to my site , I have diffrent color for my dnn and I want user to choese thier prefered.

Regards

 

 
New Post
12/16/2008 1:52 PM
 

This is typically accomplished using a set of skin objects that allow different stylesheets to be referenced based on the user's choice.  We offer a free option called CSS Selector, and there's also a popular version called Speerio.

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
12/20/2008 7:07 PM
 

DNN 5.0 will have a stylesheet widget to support that, it's also not difficult to code yourself:

Here's an example of  the way I do stuff like this.

Demo with the background-color, pure JS, no server stuff.

(Drop it on the bottom of a skin and it should work, I tested with the 4.9 default skin)

<a href=" loadCssFile ('<%=SkinPath%>Blue.css');">Blue</a>
<a href=" loadCssFile ('<%=SkinPath%>Red.css');">Red</a>
<a href=" loadCssFile ('<%=SkinPath%>Green.css');">Green</a>

<script type="text/javascript">
var sCookie = "UserStyleSheet" //Name of user style sheet Cookie
var sCssId = "CustomStyle"

var oLastCSS = readCookie (sCookie); // Get the last stylesheet from the cookie

if (undefined != oLastCSS){loadCssFile (oLastCSS);} // Load the last stylesheet saved in the Cookie
 
 function loadCssFile(filename){
 //Load a stylesheet and saves in a Cookie
  createCookie (sCookie, filename, 365);
 
 var oStyleSheet = document.getElementById(sCssId)
 if (undefined != oStyleSheet) { // If the style link was already added, change the Href
    oStyleSheet.setAttribute("href", filename)}
 else{ // Add a Css link
  var fileref=document.createElement("link");
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", filename);
    fileref.setAttribute("id", sCssId);
    document.getElementsByTagName("head")[0].appendChild(fileref);
    }
}

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,"",-1);
}

</script>

 The other thing you need is 3 CSS files, Green, Red and Blue.css, containing this:

body{background:#D00 none !important;} (with the right color)

in the root of the skin folder

 
New Post
12/31/2008 9:51 AM
 

Can this be added to the portal.css file? I'm using a skin package and have changed the skins a couple of times. I'd rather not customize the packaged skin files.

Thanks.

 
New Post
1/7/2009 4:06 PM
 

no, you cannot add js to portal.css

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Change The Skin By Vistor Change The Skin By Vistor


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out