What is a skinobject?
Skins Objects are active elements which can be included in the static HTML markup of a skin file to produce a dynamic user interface. There are a number of default skin objects included with DotNetNuke for common portal functions such as login, status, and navigation.
Custom skin objects are packaged and installed using the same process as Custom Modules ( Private Assemblies ). All of the necessary skin object resource files are combined with a DotNetNuke manifest file (*.dnn ) and packaged into a ZIP file. Example of a manifest file:
| XML - Manifest file |
Copy Code |
|
<?xml version="1.0" encoding="utf-8" ?> <dotnetnuke version="2.0" type="SkinObject"> <folders> <folder> <name>CompanyName - PageTitle</name> <modules> <module> <controls> <control> <key>PAGETITLE</key> <src>PageTitle.ascx</src> <type>SkinObject</type> </control> </controls> </module> </modules> <files> <file> <name>PageTitle.ascx</name> </file> <file> <name>YourCompanyName.PageTitle.dll</name> </file> </files> </folder> </folders> </dotnetnuke> |
For ASCX skins then you will need to specify the @Register and actual user control tag in your skin file ( ie. <dnn:Login runat="server" id="dnnLogin" /> ). If you are creating HTML skins then you simply need to specify the token ( ie. [LOGIN] ).
Skin objects support the concept of named instances. For example, if you want to have two menu controls in your skin, you can specify [MENU:1] and [MENU:2] in your skin file. In most cases you will only be using a single instance of a skin object in your skin and in this case it is fine to use a singleton instance specification ( ie. [MENU] ).
Skin objects also contain attributes. Each skin object has its own set of supported attributes. If you are creating ASCX skins then you will need to specify the attribute directly in your skin file ( ie. <dnn:Login runat=”server” id=”dnnLogin” Text=”Signin” /> ). If you are creating HTML skins then you must include your attributes specifications in a separate file – this preserves the presentation of the HTML skin file for the designer. A skin package can contain a global attributes specification named “skin.xml” (or “container.xml” for containers) which applies to all skin files in the package. In addition, you can also override the global skin attribute specification with a skin specific attribute specification by providing a “skinfilename.xml” file. The skin uploader will merge the skin attributes with the HTML presentation file to create an ASCX skin file. The following XML fragment represents the structure of the attributes file:
| XML - attributes |
Copy Code |
|
<Objects> <Object> <Token>[LOGIN]</Token> <Settings> <Setting> <Name>Text</Name> <Value>Sign in</Value> </Setting> </Settings> </Object> </Objects> |
There is a one to one correspondence of skin object declarations in your skin file (i.e. [MENU]) with the attribute specification in the XML file. This is also true for named instances.
What is a skin?
Skins are customized and interchangeable sets of graphics which allow administrators to easily change the look of their websites, without having to reorganize their content. In "skinning" a site, administrators can completely change the look of their portal without the need to reorganize content – all at the click of a button.
 |
NOTE:
Since skins are based on ASCX files which are essentially executable once they are added to an ASPX page, there is some risk that malicious script could be inserted into the skin files – putting the entire installation in danger. Be sure to download skins only from trusted locations.
|
How do skins work?
DNN uses placeholders to separate the skin objects from the static markup which designers can then include in their skin. Placeholders are simply [TOKEN] text, which uniquely identify a skin object. To mitigate the performance impact of replacing these placeholders at runtime, DNN features a simple skin upload mechanism which does the substitution of placeholders with the skin objects to produce a user control file (.ascx) which can then be rendered by the engine. This pre-processing occurs only once when the skin is uploaded.
Skins can be applied at a host (the whole DNN install), portal (only one site), or tab (single page) level. Skins can also be applied at the module level (in this case they are referred to as Containers). All skin files are organized under the Portals folder. Child assignments are able to override parent assignments (i.e. a skin applied at the tab level should override a skin applied at the portal level).
A skin or container package is comprised of multiple files which constitute a complete skin:
*.htm, *.html files – abstract skin definition files which will be processed by the skin uploader to create an *.ascx file
*.ascx files – skin definition user controls which are precompiled in the format required by the skin engine.
*.css files – styles sheets related to skins
*.gif, *.jpg, *.jpeg, *.png – supporting graphics files
*.* – any other resource files required for the skin (allowable file extensions are secured by the Host “File Upload Extensions” setting)
Skin definitions can be created using two different methods, HTML or ASCX ( user controls ). Basically the only difference between the two methods is the file extension of the skin definition file and the use of tokens versus actual user control tags.
Content panes are the containers for the content modules which are automatically injected at runtime. Content panes are simply HTML tags with some custom attributes specified specifically an ID and a RUNAT=”SERVER” attribute ( ie. <TD ID=”ContentPane” RUNAT=”SERVER”>).
What is a Container?
As mentioned earlier, containers are skin definitions which can be applied to content modules. A container is defined in exactly the same manner as a skin except for the fact that there are a different set of skin objects used in containers.
What is a module?
Simply, they are modular pieces of code which provide some form of specific functionality to the user, and are grouped together in units to form complete web pages. These modules can be easily added, edited, deleted, restored, moved around on a page, or transferred to other pages. DotNetNuke installation includes over 25 free modules. These are: Account LogIn, Announcements, Banners, Contacts, Discussion, Documents, Events List/Calendar, FAQs, Feedback, IFrame, Image, Links, News Feed (RSS), Search Input, Search Results, Service Directory, Survey, Text/HTML, User Accounts, User Defined Table, Users Online, Weblog Calendar, Weblog Recent List, Weblog Referrals List, Weblogs, and XML/XSL.