In DNN, skinning is a term that refers to the process of customizing the look and feel of the DNN portal. One of the powerful features of DNN is that the functionality of the portal is separated from the presentation of the portal. This means we can change the appearance of the portal without affecting how the portal works.
To create a skin in DNN we will work with three kinds of files: HTML, ASCX, and CSS. The HTML or ASCX file describes the layout of the page and the CSS file provides the styling. If you have worked with HTML and CSS before than you will be able to immediately get started. However, if you are familiar with ASCX (and as a DNN developer that is likely) you can achieve the same results faster than HTML. In the recipes, we will show primarily ASCX skinning with some brief examples of HTML skinning.
Before we start looking at the recipes, we need a quick word about Skin Objects. Skin Objects are used in both HTML and ASCX skin files as placeholders for different kinds of dynamic functionality. In HTML skins, you place text tokens such as [CURRENTDATE] in your code and when the code is parsed by the skin engine it will insert the matching skin object. If you are working in ASCX, you register skin objects as controls that you place directly in your code.
DNN offers many different skin objects such as CurrentDate, Logo, Login link, and others and we’ll see many of these in action in the recipes of this article.
Often the easiest way to start skinning is to download an existing skin package and see the different files used for skinning. In this recipe we will download an excellent skin created by Jon Henning from a site called CodePlex that demonstrates the most common skin objects and layouts.
Another reason for starting with an existing skin is that it allows incremental development. We can start with a fully functional skin, deploy it to our DNN portal and then edit the source files right on the server. In this way the changes we make are immediately displayed and problems are easily spotted and fixed. However, as applying a skin can affect the entire site, it is best to create and test skins on a development DNN site before using them on a production site.
Finally, it should also be noted that as a skin is really just another type of extension in DNN, you are already familiar with some of these steps.
(Move the mouse over the image to enlarge.)
File name | Description |
animated.ascx | An ASCX skin file. |
container.ascx | An ASCX container file. |
index.html | An HTML skin file. |
skin.css | The stylesheet for the skin. |
container.css | The stylesheet for the container. |
TemplateSkin.dnn | The manifest file for the skin package. |
thumbnail_animated.jpg | A preview image of the ASCX skin. |
thumbnail_container.jpg | A preview image of the ASCX container. |
thumbnail_index.jpg | A preview image of the HTML skin. |
license.txt | The text of the license agreement. |
releasenotes.txt | The text of the release notes. |
version.txt | The version number. |
Images folder | A folder holding the graphic images supporting a skin or container. |
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…