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, ...Trying to Trying to 'import' a skin into DNN... Having problems with the included CSS Files
Previous
 
Next
New Post
3/24/2008 2:44 PM
 

Afternoon folks...

Ok, I've now been handed a site design, fully html'd and css'd, by my boss.  Looks decent, and most of the content is 'containerized', so the main trick I've got is to import the existing layout into a DNN skin, then create the containers and plug in the modules I've already got built. 

This 'template' I've been given has Javascript and CSS files which I need to include into the site.

I've now removed the content containers from the site and set up content panes where they will go.  Added .js to the accepted files list under host settings so that those files will upload correctly. 

Now, the problem I'm running into is that when I upload the skin, things go south.

I think I have figured out WHAT the problem is, but am not sure how to deal with it.  It is my belief that the error which is being represented by

A critical error has occurred.
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Is actually being caused by the fact that the assorted CSS (and possibly JavaScript) files which I am using on this page, are not being called correctly.  During the skin upload process, I have noticed alot of lines like this

Substituting: <link type="text/css" rel="stylesheet" media="" href="content/css/layout.css">
With: <link type="text/css" rel="stylesheet" media="" href="<%= SkinPath %>content/css/layout.css">

in the import report.   I've noticed it on the images as well, but they are showing up correctly... It's my belief that the <%= SkinPath %> occuring in the page header, where you are supposed to put links to any and all CSS files (and JS files) is whats causing the problem.  From some googling, you're not supposed to put <% into the page header, but DNN is the one doing this... As such, I'm not sure of how to solve this problem...

Any thoughts would be appreciated... I'm on a pretty tight deadline here and the longer I'm stalled by this problem in even loading the skin, the less time I can be working on content modules.


Thanks,
Brian

 

 
New Post
3/24/2008 3:27 PM
 

Brian,

Skins are User Controls, so they won't have access to the head.  You should put the refrerences at the top of your body.

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
3/24/2008 9:32 PM
 

*nods* 

I see what you were saying... One issue that I noted was that the process of uploading the skin seemed to strip out the css includes that I was putting in. 

So, what you said only was 50% of the issue.  I also ended up using ResolveURL capability, having the six additional CSS files resolve into the body of the skin.  I didn't realize it at the time that I wasn't using skin.css at all... 

<link rel="stylesheet" href='<%= ResolveUrl("~/DesktopModules/path/path/path/layout.css") %>' type="text/css" />

This is a good thing, overall, because I'm going to have to have some logic working that will tell the site which CSS files to use, and the ResolveURL method works well with that. 

Downside here is that, because I'm now dependant on IIS to resolve the locations of my CSS files, I cannot see the site correctly at design time. 

Tonight's goal is to research the same functionality for JavaScript so I can get all of the JS files we have loading as well.  Once both sets of files are resolving correctly, then I've got the basics of the skin imported and then I've just got to get the new containers working and badda bing, my boss will be happy on monday...

Can you explain to me why DNN seems to strip out any additional CSS files that are included in the skin during the upload process?

Brian

 
New Post
3/24/2008 10:44 PM
 

Is there a reason that you don't want to import the CSS files to the skin.css using "@import" tag?


Cuong Dang
Co-founder: Enliven, dnnGallery
LinkedIn | Twitter
I'm the author of DNN and Web Standards Wrox Blox

 
New Post
3/25/2008 11:17 AM
 

Well, if by want, you mean, is there a reason I'm against it, then no... Or, if by want, you mean, why didn't I think of that *laughs* 

Seriously though, I'm not sure that @import, now that I'm thinking about it is a good big picture solution.  The reason for this is that I'm going to need to be able to use different CSS files, depending on what URL path I'm at, for various skins... Basically, we're going to have different CSS 'skins' for different parts of the site, all of which, hopefully, will eventually be using just a couple of actual skin files... As such, since a CSS is a text only file, and cannot contain any functional logic, simply importing all of the CSS files into a single skin.css wouldn't be a viable solution.

Brian

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Trying to Trying to 'import' a skin into DNN... Having problems with the included CSS Files


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