DCSIMG
Create DotNetNuke Skin - Shai Raiten

Shai Raiten

 Subscribe

Create DotNetNuke Skin

Create DotNetNuke Skin

Skins and modules are the reasons that DotNetNuke became so popular. They just get you involved. From the early versions you could skin it working with one HTML and one CSS file when for the most of the modern web applications out there, you have to deal with a bunch of files (sometimes and images!) to make them look the way you want.

With this tutorial I'll try to make you understand the basics about DotNetNuke skins and hopefully you'll learn how to create your own first skin from a static HTML page.

1) Skin folders

On your desktop, or wherever you want, create a new folder with the name "MyFirstSkin", that's the name of the skin we'll develop. In that folder create another one with the name "skins"

2) The skin.ascx from a static HTML page

First thing we have to do is to decide the way we want our pages to look like. Create a new HTML page so we can define what goes where.
As you can see all I did was to define the areas where later we'll put the dynamic content. We save this file as "skin.ascx" in the "MyFirstSkin/skins/" folder.

<!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>
       
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <
title>Untitled Document</title>
       
<style>
            body
{background:#555;}
           
.skinwrapper{border:5px #333 solid;background:#FFF;padding:1px;}
           
.skinheader{padding:10px;background:#EEE;}
           
.skinmenu{padding:10px;background:#C00;}
           
.skinuser{padding:5px;background:#CCC;text-align:right;}
           
.skincontentstable{width:100%;}
           
.leftpane{background:#EEE;width:200px;}
           
.contentpane{background:#FFF;}
           
.rightpane{background:#EEE;width:200px;}
           
.skinfooter{padding:5px;background:#CCC;text-align:center;}
        </
style>
   
</head>
   
<body>
       
<div class="skinwrapper">
           
<div class="skinheader">Logo</div>
           
<div class="skinmenu">Menu</div>
           
<div class="skinuser">Register - Login</div>
           
<table border="0" cellpadding="10" cellspacing="0" class="skincontentstable" summary="Design Table">
               
<tr valign="top">
                   
<td class="leftpane">Left Pane</td>
                   
<td class="contentpane">Content Pane</td>
                   
<td class="rightpane">Right Pane</td>
               
</tr>
           
</table>
           
<div class="skinfooter">Copyright</div>
       
</div>
   
</body>
   
</html>
 
3) The skin.css and our skin.ascx page clean up

For the skin we need only everything in the "body" tag and the CSS styles we have included in the head area. So we "Cut" the styles inside the "style" tag and we "Paste" them in a new CSS file with the name "skin.css". We save this file in the same "MyFirstSkin/skins/" folder. Now we can remove the unneeded tags from the skin.ascx page... we keep only everything in the "body" tag.

In our skin.ascx file:

<div class="skinwrapper">  
   
<div class="skinheader">Logo</div>  
   
<div class="skinmenu">Menu</div>  
   
<div class="skinuser">Register - Login</div>  
   
<table border="0" cellpadding="10" cellspacing="0" class="skincontentstable" summary="Design Table">  
       
<tr valign="top">  
           
<td class="leftpane">Left Pane</td>  
           
<td class="contentpane">Content Pane</td>  
           
<td class="rightpane">Right Pane</td>  
       
</tr>  
   
</table>  
   
<div class="skinfooter">Copyright</div>  
</div> 

In our skin.css file:

body{background:#555;}   
.skinwrapper{border:5px #333 solid;background:#FFF;padding:1px;}   
.skinheader{padding:10px;background:#EEE;}   
.skinmenu{padding:10px;background:#C00;}   
.skinuser{padding:5px;background:#CCC;text-align:right;}   
.skincontentstable{width:100%;}   
.leftpane{background:#EEE;width:200px;}   
.contentpane{background:#FFF;}   
.rightpane{background:#EEE;width:200px;}   
.skinfooter{padding:5px;background:#CCC;text-align:center;}  

4) DotNetNuke skin objects and the dreamweaver extension

Skin objects are special tags that DotNetNuke recognizes as dynamic content placeholders. So when we write this tag: <dnn:LOGO runat="server" id="dnnLOGO" /> we tell DotNetNuke to put our portal's logo in that place. Dynamic means that we'll be able to change the logo image from our portal's "Site Settings" without touch the code again. Let's put the skin objects in the areas we have specified, using the dreamweaver extension.

<%@ Control language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
   
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
   
<%@ Register TagPrefix="dnn" TagName="SOLPARTMENU" Src="~/Admin/Skins/SolPartMenu.ascx" %>
   
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
   
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
   
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>

   
<div class="skinwrapper">
       
<div class="skinheader"><dnn:LOGO runat="server" id="dnnLOGO" /></div>
       
<div class="skinmenu">
           
<dnn:SOLPARTMENU
            runat="server"
            id="dnnSOLPARTMENU"
            usearrows="true"
            userootbreadcrumbarrow="false"
            usesubmenubreadcrumbarrow="false"
            rootmenuitemlefthtml="
<span>"
            rootmenuitemrighthtml="
</span>"
            rootmenuitemcssclass="rootmenuitem"
            rootmenuitemselectedcssclass="rootmenuitemselected"
            rootmenuitembreadcrumbcssclass="rootmenuitembreadcrumb"
            submenucssclass="submenu"
            submenuitemselectedcssclass="submenuitemselected"
            submenuitembreadcrumbcssclass="submenuitembreadcrumb"
            CSSNodeSelectedRoot="rootmenuitembreadcrumb"
            CSSNodeSelectedSub="submenuitembreadcrumb"
            delaysubmenuload="true"
            />
       
</div>
       
<div class="skinuser">
           
<dnn:USER runat="server" id="dnnUSER" CssClass="skinuser" />
            -
            <
dnn:LOGIN runat="server" id="dnnLOGIN" CssClass="skinuser" />
        </
div>
       
<table border="0" cellpadding="0" cellspacing="0" class="skincontentstable" summary="Design Table">
           
<tr valign="top">
               
<td id="LeftPane" runat="server" width="200" nowrap class="leftpane" visible="false"></td>
               
<td id="ContentPane" runat="server" class="contentpane"></td>
               
<td id="RightPane" runat="server" width="200" nowrap class="rightpane" visible="false"></td>
           
</tr>
       
</table>
       
<div class="skinfooter"><dnn:COPYRIGHT runat="server" id="dnnCOPYRIGHT" CssClass="skinfooter" /></div>
   
</div>
5. Ready to upload it?

In order to make our skin available to our portal, we have to upload it using the admin interface (advanced user may also use FTP to upload the skin files). Let's browse the "MyFirstSkin/skins/" folder and compress the skin.ascx and the skin.css in a MyFirstSkin.zip file.

It's time to run our browser and type in the address bar our DotNetNuke's portal URL, login and apply the skin!

Comments

Fatima Hussain said:

Hi

Your work is wounder. keep it up :-)

bye

# November 14, 2008 7:09 AM

Baldev Rawat said:

Gr8. Keep the good work going.......

Thanks

# December 2, 2008 1:24 PM

Gillo said:

Hi, I am lost here....DotNetNuke skin objects and the dreamweaver extension

would you mind to explain how to work in this area please????

Thanks

# January 26, 2009 6:48 AM

Nirav Chikani said:

Dear sir,

I have a html page layout and Now I want to create a Skin and container from this Html Layout.

So Please help me and reply me as soon as possible,

Thanks,

Nirav Chikani

niravchikani@gmail.com

# March 30, 2009 2:41 PM

sansugoi said:

Hello sir,

I have created skin in div tag, it is working fine in IE but when I check in mozzila then all the content coming dunamicaly is shiffted in right side of the page, can you please help me out of this...

# May 16, 2009 11:47 AM

JP said:

I did everything indicated, and when I preview the skin it shows fine, however, when I apply it, the content reverts back to the minimalextrophy design.  What's up with that?

# May 20, 2009 7:13 PM

sparow said:

I may be late to commend your work, but your work worth commendation. thanks

# October 28, 2009 10:26 PM

Uday said:

really gr8, Keep it up.

# November 27, 2009 2:05 PM

Uday said:

Too good. Keep it up.

# November 27, 2009 2:08 PM

狠D调 said:

CreateDotNetNukeContainer

InCreateDotNetNukeSkinwesawhowtocreateDotNetNukeSkinandnow...

# December 9, 2009 5:18 AM

DNNFreelance said:

Hi there. I need a freelancer ASAP. To create a skin from PSD. Feel free to contact me om MSN: dnnfreelance@gmail.com   Thank you.

# January 9, 2010 12:43 PM

mini said:

very good article

# July 26, 2010 2:58 PM

dymmepheden said:

Shield EC: new generation of antivirus. Online software stores started selling Shield EC antivirus. The new software provides efficient protection against banking trojans and viruses, including the notorious ZeuS – a thunderbolt of Internet banking all over the globe.

Shield EC is a result of two-year research and close collaboration of programmers and analysts from Martindale Enterprises LTD and Zeus Tracker, the main center for ZeuS epidemic prevention. The team of developers has received dozens of builds for comprehensive analysis, that’s why the output became a turnkey product, guaranteed to neutralize the threat, prevent data theft and money loss. Shield EC ensures the proactive protection of a PC even if the signature code hasn’t got to the antivirus databases yet.

"After two years of intense work we have gained quite impressive results. Introducing Shield EC to the market is another step towards making the Internet safe," says Kseniya Vasilyeva, the spokesperson for Martindale Enterprises Limited.

If you do have something to lose, install Shied EC to protect your bank accounts.

# August 11, 2010 7:31 AM

Arul Baskar said:

how to user create dotnetnuke skins please helpme now.

by baskar

# January 24, 2011 9:46 AM

Sunil Botadara said:

Thanks dear its helpful for me

# February 3, 2011 5:24 PM

m.a said:

excellent....thanks much

# February 12, 2011 9:46 AM

Nour said:

If I have JS in the page how can i add that as Skin objects

# March 21, 2011 7:12 PM

how to design dnn skins said:

Pingback from  how to design dnn skins

# May 4, 2011 11:59 AM

Ric said:

I have been searching for days for skinning explained this way. Cheers

# August 10, 2011 9:25 AM

Tejas Shah said:

Sir, I have HTML page and I want to make DNN skin from HTML page.How can I do?Please help.

# August 30, 2011 9:17 AM

Shashank said:

This is one of the great help. I have searched this on many sites but now only i got it Thanks Mr.

# October 17, 2011 1:47 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: