Last post May 26, 2006 11:12 AM by J7Mitch
May 26, 2006 05:58 AM|marcink|LINK
May 26, 2006 11:12 AM|J7Mitch|LINK
I believe there is a small confusion about what a DNN Skin is.
The skin is actually the .ascx file, not the folder that the skin is in. A skin folder can have many different skins in it like home.ascx and content.ascx.
All skins in the skin folder will use the file called skin.css. This is your global css file for all the skins in the skin folder.
So, when you say you have a skin called MySkin, what you really mean is that you have a skin package called MySkin, and it has different skins in called home.ascx, and content.ascx.
When a skin package is uploaded, it creates a skin folder with the same name.
Each skin in the skin folder will also load a specific css file that matches it's name, so if there is a home.ascx skin, it will load a home.css file if one is available.
To answer the question more specfically, No, you do dont need to create multiple skin packages in their own folders to accomplish what you are trying to do.
I don't blame you for the confusion, after-all we have a property exposed called "SkinPath", which maybe should technically be called "SkinFolderPath" as the property points to the Skin Folder.
You can use that property to reference an Images folder from your skin like this:
<img src="<%= SkinPath %>/Images/myimage.gif" />
Now, you can get really fancy and take this a step further if you like.
Create themed images for all your skins in your skin package by creating subfolders to your skin package's Images folder with a structure like this:
Then you could place an image in the MySkinPackage\Images\Home folder with the name "banner.gif".
Then place an image with a different graphic but use the same name "banner.gif" in the MySkinPackage\Images\Content folder.
And the code for the src of the image would look like this:
<img src='<%= SkinPath %>/Images/<%=Replace(PortalSettings.ActiveTab.SkinSrc, ".ascx", "")%>/banner.gif' />
Thats probably overkill though, because you can get the same "themes structure" more gracefully through CSS using the individual skin's css file (ie. home.css or content.css) and background images.
Check out my blog for some other insight and tricks for skins.