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
6/2/2009 2:18 PM
 

Hello

I am getting error using this code , when I click on Blue or red or green it's redirect me to this url : 

http://localhost/test/portals/_default/skins/a23/%20loadCssFile%20('/test/Portals/_default/Skins/a23/Green.css');

this is my index.html

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

 

<

<

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">html xmlns="http://www.w3.org/1999/xhtml">head>

 

<link rel="stylesheet" type="text/css" href="skin.css" />

 

 

</

<

<title></title>head>body>

 

<div>

 

 

<div class="template_style">

 

<div id="ControlPanel" runat="server" />

 

<div class="top_space">

 

<div class="lang_pad">

 

&nbsp;</div>

 

</div>

 

<div class="logo_top">

 

<div class="logo_top_left">

 

<div class="logo_top_right">

 

<div class="logo_top_bg">

 

<div id="login_style" class="user">

 

&nbsp;[LOGIN]&nbsp;</div>

 

</div>

 

</div>

 

</div>

 

<div class="logo_left">

 

<div class="logo_right">

 

<div class="logo_pad">

[LOGO]

</div>

 

</div>

 

</div>

 

</div>

 

<div class="menu_left">

 

<div class="menu_right">

 

<div class="menu_bg">

[NAV]

<div class="clear_float">

 

</div>

 

</div>

 

</div>

 

</div>

 

<div class="bread_left">

 

<div class="bread_right">

 

<div class="bread_bg">

 

<div id="bread_style">

You Are Here :

&nbsp;<span>[BREADCRUMB]</span>

 

</div>

 

 

<div class="clear_float">

 

</div>

 

</div>

 

</div>

 

</div>

 

<div class="center_bg">

 

<div class="left_bg">

 

<div class="right_bg">

 

<div class="content_pad">

 

<div class="content_width">

 

<table border="0" cellpadding="0" cellspacing="0" width="100%">

 

<tr>

 

<td id="TopPane" runat="server" class="TopPane" colspan="3" valign="top" visible="false">

 

</td>

 

</tr>

 

<tr>

 

<td id="LeftPane" runat="server" class="LeftPane" valign="top" visible="false">

 

</td>

 

<td id="ContentPane" runat="server" class="ContentPane" valign="top" visible="false">

 

</td>

 

<td id="RightPane" runat="server" class="RightPane" valign="top" visible="false">

 

</td>

 

</tr>

 

<tr>

 

<td id="BottomPane" runat="server" class="BottomPane" colspan="3" valign="top" visible="false">

 

</td>

 

</tr>

 

</table>

 

</div>

 

</div>

 

</div>

 

</div>

 

</div>

 

<div class="bot_left">

 

<div class="bot_right">

 

<div class="bot_bg links">

 

</div>

 

</div>

 

</div>

 

<div class="bot_pad">

 

<div id="copy_style" class="footer">

[COPYRIGHT]

</div>

 

<div id="Div1" class="footer">

 

&nbsp;</div>

 

<div class="clear_float">

 

&nbsp;</div>

 

</div>

 

</div>

 

 

<

<

<

 

 

 

<

var

</div>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"> 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

 

fileref.setAttribute(

fileref.setAttribute(

fileref.setAttribute(

fileref.setAttribute(

document.getElementsByTagName(

}

}

var fileref=document.createElement("link");"rel", "stylesheet");"type", "text/css");"href", filename);"id", sCssId);"head")[0].appendChild(fileref);

function

 

 

date.setTime(date.getTime()+(days*24*60*60*1000));

 

}

 

document.cookie = name+

}

createCookie(name,value,days) {if (days) {var date = new Date();var expires = "; expires="+date.toGMTString();else var expires = "";"="+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

createCookie(name,

}

eraseCookie(name) {"",-1);

</

 

</

 

</

script>body>html>

 

 

 

 

 

Please Help

 

 
New Post
6/2/2009 3:23 PM
 

the code I showed can only be used that way in an ASCX skin, not an HTML skin

 
New Post
6/2/2009 5:16 PM
 

Can You please explain in Details , I couldn't do it even in acsx , it's giving same error

 
New Post
6/2/2009 6:38 PM
 

I would go the javascript way not with loading css but much simpler

 

<div id="#Wrapper">

 

</div>

 

in css you can do #Wrapper.red   or #Wrapper.blue

 

then you need functions to write the cookies\

 

something like

 

    function saveThemeName(name) {
        setCookie(THEME, name);
    }

    function getThemeName() {
        return getCookie(THEME);
    }

 

and then you would need to make a dropdown or checkbx to set the skin in your code.

 

then onload of the page you just check f there is a theme cookie and if yes add the class to the wrapper div

 

        var themeName = getThemeName();
        jQuery("#Wrapper").addClass(themeName);

 

fill in the blanks yyourself

 

 


 
New Post
6/3/2009 11:32 AM
 

I couldn't do that

:( 

 

 
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