Style.config adding a CSS file

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
9/30/2009 1:58:00 PM
Gravatar
Total Posts 7

Style.config adding a CSS file

I created a new css file (located my the sites\1\skins\newskin directory) called  scrollstyle.css

I then added the following line in the style.config file

<file>scrollstyle.css</file>

 

However when I load up the page/site, the styles aren't there and the link to scrollstyle.css file isn't added in the header section.

 

What am I missing?

9/30/2009 2:55:19 PM
Gravatar
Total Posts 2187

Re: Style.config adding a CSS file

By default mojo caches the css and html for the site to improve speed. If you are modifying skins, I suggest you set the following in your user.config file and then "touch" the web.config (open it, add a space, save it). After doing this, reset your browser's cache.

<add key="CacheCssOnServer" value="false" />
<add key="CacheCssInBrowser" value="false" />

If you just want to see your new css file added, you can just touch the web.config and clear your browser cache.

You will not see a link to the scrollstyle.css file in the header because the css files listed in the style.config are combined using mojo's CSS Handler. You will instead see a single link to the csshandler.ashx file.

Hope this helps,
Joe D.

2/3/2010 1:33:37 PM
Gravatar
Total Posts 156

Re: Style.config adding a CSS file

My style.config looks like so:

<?xml version="1.0" encoding="utf-8" ?>
<cssfiles>
  <file>style.css</file>
</cssfiles> 

 

I've added these two lines to the appSettings section in user.config, added a space to web.config in order to update the settings

<add key="CacheCssOnServer" value="false" />
<add key="CacheCssInBrowser" value="false" /> 

 

 

However, when I go to mojoPortal, it shows the following in the header and none of my styling applies and no images are shown/found:

 

<link href="App_Themes/default/theme.css" type="text/css" rel="stylesheet" />
<link rel='canonical' href='http://testportal.univrel.niu.edu/home.aspx' /><style type="text/css">
.ctl01_SiteMenu1_ctl00_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
.ctl01_SiteMenu1_ctl00_1 { text-decoration:none; }
.ctl01_SiteMenu1_ctl00_2 { }

</style> 

 

 

 

What am I missing? 

2/3/2010 1:38:42 PM
Gravatar
Total Posts 18439

Re: Style.config adding a CSS file

Does your layout.master file have the StylesheetCombiner control?

What version of mojoPortal?

Hope it helps,

Joe

2/3/2010 1:59:53 PM
Gravatar
Total Posts 156

Re: Style.config adding a CSS file

Joe,

 

Now it just looks like the default skin with green and some black and default links like site map ( http://bit.ly/cUDBUJ )

 

This is what my plain html/css template looks like and that's what the mojorPortal template is supposed to looks like (http://bit.ly/9JPrOd )

 

I'm running the latest stable version.

2/3/2010 2:08:21 PM
Gravatar
Total Posts 18439

Re: Style.config adding a CSS file

You should check the mojoportal logs, it sounds like an error in your layout.master, it will fall back to a known layout.master page if there are errors loading yours.

This problem does not exist in included skins so you need to figure out what you are doing wrong in your skin. I recommend don't chop stuff out unless you know what they are for.

Hope it helps,

Joe

2/3/2010 2:18:06 PM
Gravatar
Total Posts 156

Re: Style.config adding a CSS file

Joe,  I used the basic layout.master from the docs and just took out the following:

                    <portal:SiteTitle id="SiteTitle1" runat="server" />
                    <portal:SkipLink id="SkipLink1" runat="server" />
                    <portal:SiteMenu id="SiteMenu1" runat="server" TopLevelOnly="true"
UseTreeView="false" HideMenuOnSiteMap="false"
Direction="Horizonatal" /> 

 

The rest is what you had in there. This is what I have currently:

 

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="~/App_MasterPages/layout.Master.cs" Inherits="mojoPortal.Web.layout" %>
<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
    <portal:StyleSheetCombiner id="StyleSheetCombiner" runat="" UseIconsForAdminLinks="false" />
    <title>NIU Foundation</title>
</head>
<body class="pagebody">
    <form id="frmMain" runat="server">

        <asp:SiteMapDataSource ID="SiteMapData" runat="server" ShowStartingNode="false" />
        <asp:SiteMapDataSource ID="ChildPageSiteMapData" runat="server" ShowStartingNode="false" />
        <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />

<div id="wrapwebsite">
<div id="wrapheader">
<div id="logo_nav">
<img src="assets/images/true_north_logo.jpg" alt="True North" />
</div>
<div id="header_nav">
<a href="http://www.niu.edu">
<img src="assets/images/niu_logo.jpg" alt="Northern Illinois University" />
</a>
<ul>
<li><a href="true_north.asp">About True North</a> | </li>
<li><a href="foundation.asp">About the NIU Foundation</a> | </li>
<li><a href="contacts_by_name_or_office.asp">Contact Us</a> | </li>
<li><a href="ways_to_give.asp">Ways To Give</a> | </li>
<li><a href="make_a_gift.asp">Make A Gift</a> | </li>
<li>
<a href="http://blog.niu.edu/truenorth">
<img src="assets/images/tn.gif" alt="Blog" />
</a>
</li>
</ul>
</div>
</div>
<div id="wrapcontent">
<div id="banner">
<img src="assets/images/navigation.gif" alt="Navigation Menu" usemap="#banner_nav" />
<img src="assets/images/headers/make_a_gift_header.jpg" alt="Header" />

<map name="banner_nav" id="banner_nav">
<area shape="rect" coords="42,112,186,130" href="student_stories.asp" alt="Student Stores" />
<area shape="rect" coords="40,134,189,153" href="donor_stories.asp" alt="Donor Stories" />
<area shape="rect" coords="41,160,185,181" href="reconnect.asp" alt="Rediscover NIU" />
<area shape="rect" coords="45,218,169,240" href="make_a_gift.asp" alt="Estate Gifts" />
<area shape="rect" coords="45,186,184,204" href="http://www.plan.gs/Home.do?orgId=273" alt="Make a Gift Today" target="_self" />
</map>
</div>
<asp:Panel id="divLeft" runat="server" cssclass="leftside" visible="True" SkinID="pnlPlain">
<asp:contentplaceholder ID="leftContent" runat="server"></asp:contentplaceholder>
</asp:Panel>

<asp:Panel id="divCenter" runat="server" visible="True" cssclass="center-rightandleftmargins" SkinID="pnlPlain">
<asp:ContentPlaceHolder ID="mainContent" runat="server"></asp:ContentPlaceHolder>
</asp:Panel>

<asp:Panel id="divRight" runat="server" visible="True" cssclass="rightside" SkinID="pnlPlain">
<asp:contentplaceholder ID="rightContent" runat="server"></asp:contentplaceholder>
</asp:Panel>
</div>
<div id="wrapfooter">
<ul>
<li><a href="student_stories.asp">Student Stories</a> | </li>
<li><a href="donor_stories.asp">Donor Stories</a> | </li>
<li><a href="venture_grant.asp">Venture Grants</a> | </li>
<li><a href="message.asp">True North Message</a> | </li>
<li><a href="campaign_team.asp">Campaign Team</a> | </li>
<li><a href="our_goal.asp">Giving Opportunities</a> | </li>
<li><a href="make_a_gift.asp">Make A Gift</a></li>
<li><span class="tabbed">DeKalb, Illinois 60115 |</span></li>
<li><a href="mailto:niufoundation@wpo.cso.niu.edu">E-mail Us</a> | </li>
<li><a href="http://www.its.niiu.edu/its/Policies/privacy_policy.shtml">Privacy Policy</a></li>
</ul>

<p>&copy; 2007 Northern Illinois University Foundation. All rights reserved</p>
<p>Developed by <a href="http://www.monroestar.com" target="_blank">Monroestar</a></p>

</div>

<asp:ContentPlaceHolder ID="pageEditContent" runat="server"></asp:ContentPlaceHolder>

</div>
</form>
</body>
</html>
  

 

2/3/2010 2:23:28 PM
Gravatar
Total Posts 18439

Re: Style.config adding a CSS file

Do you have troubles using included skins with no modifications?

Are you seeing skin related errors in your log?

What is the structure of the url? a root site or 1 folder deep?

Is the site at a public url where I could view the source of the rendered page? You can email it to me if you'd rather not post it joe dot audette at g mail dotcom

fyi, on a side note if you are just getting started I made a new release today.

Best,

Joe

2/3/2010 2:50:09 PM
Gravatar
Total Posts 156

Re: Style.config adding a CSS file

No, the stock skins seem to work fine.

I just added a skin folder to 1/skins and selected the new skin from the drop down in the site settings.

 

This is what I get in the log:  

 

 

2010-02-03 14:48:10,866 ERROR mojoPortal.Web.mojoBasePage - Error setting master page. Will try setting to default skin.en-US - 131.156.71.164
System.Web.HttpParseException: The Runat attribute must have the value Server. ---> System.Web.HttpParseException: The Runat attribute must have the value Server. ---> System.Web.HttpException: The Runat attribute must have the value Server.
   at System.Web.UI.TemplateParser.ProcessError(String message)
   at System.Web.UI.TemplateParser.ProcessAttributes(Match match, ParsedAttributeCollection& attribs, Boolean fDirective, String& duplicateAttribute)
   at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   --- End of inner exception stack trace ---
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   --- End of inner exception stack trace ---
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
   at System.Web.UI.Page.get_Master()
   at mojoPortal.Web.mojoBasePage.SetupMasterPage()
   at mojoPortal.Web.mojoBasePage.OnPreInit(EventArgs e)
 

 

 

 

The ironic thing is that it's like it loads some of the template correctly because the background is from my template and some of the links are styled using my styles as well, but the rest is completely foreign.

I'll email the URL in a minute.

2/3/2010 2:52:48 PM
Gravatar
Total Posts 18439

Re: Style.config adding a CSS file

Ok, now that I see the error I was able to spot the problem in what you posted:

 <portal:StyleSheetCombiner id="StyleSheetCombiner" runat="" UseIconsForAdminLinks="false" />

you need

 <portal:StyleSheetCombiner id="StyleSheetCombiner" runat="server" UseIconsForAdminLinks="false" />

Hope it helps,

Joe

2/3/2010 2:57:11 PM
Gravatar
Total Posts 156

Re: Style.config adding a CSS file

Thank you so much Joe. Just sent you an email because I'm still having trouble with images, etc.

You must sign in to post in the forums. This thread is closed to new posts.