N2 and App_Theme style sheets.

Topics: Developer Forum, User Forum
Oct 20, 2008 at 6:43 PM
I integrated N2 into an existing site with an existing theme, and now all the css files in the App_Theme folder are not getting rendered. I noticed in the debugger some calls to register some css and javascript. At any point, are you removing css files (link ref's)?
Oct 20, 2008 at 6:44 PM
Note: it only does this when N2 find a contentitem at the url. If I were to visit a static page, the themes css files get loaded.
Oct 20, 2008 at 8:11 PM
Are you using functional templates? There is some code in the TemplatePage class to dynamically update the theme based on a choice on the start page node. See if you can select your existing theme on the site tab on the start page.
Oct 21, 2008 at 4:06 AM
I have selected the theme in the StartPage edit panel.

I looked in the debugger in the ThemeModifier and the page is successfully getting its Page.Theme set.

For good measure, I also used resharper to find every reference to Page.Theme (at least in web app, not n2, its compiled) and there is no other reference to it besides the one in the IPageModifier.

I think there is some event somewhere in N2.dll that responds to every httprequest the is related to a N2.ContentItem (page). Where do I look next?
Oct 21, 2008 at 6:12 AM
Look in N2.Web.UrlRewriter and N2.Web.RequestLifecycleHandler. Can it be that the theme links are there but gets skewed during rewrite?

Possibly try changing <n2><host><web rewriteMethod...
Oct 22, 2008 at 2:34 AM
Didn't turn up anything.

I set a break point into to see whats in the header before all the javascript and css gets injected, and there was no style sheet references.

Like I said, the Page.Theme is correct during the OnPageLoad event.

This is weird.

Maybe I can zip up the solution to you and you can see what you can find? This error was not here before I put N2 into the app, and at the same time, it seems to be buried deep inside of .NET
Oct 22, 2008 at 11:27 AM
Well I started from ground zero on my app again.

Integrated N2 the same way I did before and kept notice exactly when this bug arose.

Guess what? It didn't. It works now.

God knows what happend...
Oct 22, 2008 at 7:36 PM
Well, great! If you find out what was the cause let us know, it might help out someone.