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, ...switch skins.switch skins.
Previous
 
Next
New Post
2/4/2008 2:00 AM
 

Hi all,

          I want to allow users to change / switch skin, how to make this, need directions.

murthy.

 

 
New Post
2/4/2008 4:33 AM
 

A long time ago, a user asked this question, and someone answered the answer bellow, I took the answer and saved in a text file because I found it usefull, I do not know who wrote this answer, so I appologize to him that I am using the answer without referencing the author:

 

The core code allows you to override the DNN skin.  This is all that the DNN site skin is doing.  There are 2 ways to override the skin.  First, by a querystring.  This is the method that is used to preview the skins in the Page Settings, Site Settings, and Skin Manager.  The other way is to set a cookie.  This is the method that the DNN site is using.  Upon clicking the icon, a cookie is set.  When the page reloads, the skin in the cookie is used instead of the skin that is specified in the Page/Site Settings.

function sizeLayout(size){    setSkinCookie("DotNetNuke_Skin_Layout_Size",size, new Date("December 31, 2010 23:59:59"),"/");    location.reload();}
function setSkinCookie(name, value, expires, path, domain, secure) {  var curCookie = name + "=" + escape(value) +      ((expires) ? "; expires=" + expires.toGMTString() : "") +      ((path) ? "; path=" + path : "") +      ((domain) ? "; domain=" + domain : "") +      ((secure) ? "; secure" : "");  document.cookie = curCookie;}

 


Bilal Al-Ghazi
 
New Post
2/4/2008 5:00 AM
 

HI

I posted a solution for this in another thread, there it was differnt skins based on domain. In order to make this work for your use you only need to make a simple module that allows user to select a skins, then just set a cookie based on this cookie you change the skin in the part where I have the skin change based on domain

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/109/threadid/198606/scope/posts/Default.aspx

 

 

 
New Post
3/18/2008 7:49 AM
 

I copied the code below from the DNN site into my site, but nothing (other than a page refresh) happens when clicking the images.

Feeling a bit dense here... I am not sure how setting this cookie value is supposed to work. How does DNN know which skin to use? If I have 10 skins with different names on my site, just providing a number (e.g., 0, 1, 2) does not seem to be enough info to indicate the correct skin. Is the skin supposed to have a specific name with a numeric value appended to the end?

Thanks in advance for your wisdom!

Code copied from DNN site:
<script language="Javascript">
function setSkinCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
</script>
<script language="Javascript">
function sizeText(size)
{
    setSkinCookie("DotNetNuke_Skin_Text_Size", size, new Date("December 31, 2010 23:59:59"),"/");
    location.reload();
}
</script>

<a href=" void(0)"><img src="/Portals/_default/Skins/DNN-Minimal/controls/images/icon_textsmall_on.gif" onClick="sizeText(0)" width="17" height="17" alt="Small text" border="0"></a>
<a href=" void(0)"><img src="/Portals/_default/Skins/DNN-Minimal/controls/images/icon_textmedium.gif" onClick="sizeText(1)" width="17" height="17" alt="Medium text" border="0"></a>
<a href=" void(0)"><img src="/Portals/_default/Skins/DNN-Minimal/controls/images/icon_textlarge.gif" onClick="sizeText(2)" width="17" height="17" alt="Large text" border="0"></a>

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...switch skins.switch skins.


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