When I put html markup in a master page that inherits from another masterpage, the stylesheet is not being picked up. For example, my top level masterpage is named MasterTemplate. The MasterTemplate references a stylesheet and that is currently working fine. I have another template that inherits from MasterTemplate and is coded like this (Content_ChildContent is the content placeholder in the MasterTemplate):
I can see the text that I inject in the mainContent1 field, but it has no styling applied to it. what I'm trying to do is draw a box around the content area. I don't want the box drawn in the MasterTemplate because when I had it there, it was showing up even on pages that don't require it.
<link href="~/css/Styles.css" rel="stylesheet" type="text/css" />. I just tried taking the ~ out, and that made it so none of the pages find the stylesheet.
It is working now...and I don't even know what I did. I just started poking around, tweaking here and there and then all of a sudden it worked. My stylesheet is still referenced as above with the ~. My child masterpages are inheriting the markup from the master, but also able to inject their own markup and content, and the stylesheet is now being applied. Perhaps I didn't refresh my page enough and maybe I should have tried republishing the entire site... So now to move forward!
Nested MasterPages
Hi,
When I put html markup in a master page that inherits from another masterpage, the stylesheet is not being picked up. For example, my top level masterpage is named MasterTemplate. The MasterTemplate references a stylesheet and that is currently working fine. I have another template that inherits from MasterTemplate and is coded like this (Content_ChildContent is the content placeholder in the MasterTemplate):
<%@ Master Language="C#" MasterPageFile="~/masterpages/MasterTemplate.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="Content_ChildContent" runat="server">
<!-- start content box -->
<div class="contentbox" align="left">
<span class="contentheader">Header for Box</span>
<div class="contentcontent">
<umbraco:Item field="mainContent1" runat="server"></umbraco:Item>
</div>
</div>
<!-- end content box -->
</asp:Content>
I can see the text that I inject in the mainContent1 field, but it has no styling applied to it. what I'm trying to do is draw a box around the content area. I don't want the box drawn in the MasterTemplate because when I had it there, it was showing up even on pages that don't require it.
thanks.
Candice
Do you have a "/" before your stylesheet reference?
As in
<link type="text/css" rel="stylesheet" href="/css/all.css"/>
Rich
Hi Rich,
My stylesheet reference looks like this:
<link href="~/css/Styles.css" rel="stylesheet" type="text/css" />. I just tried taking the ~ out, and that made it so none of the pages find the stylesheet.
It is working now...and I don't even know what I did. I just started poking around, tweaking here and there and then all of a sudden it worked. My stylesheet is still referenced as above with the ~. My child masterpages are inheriting the markup from the master, but also able to inject their own markup and content, and the stylesheet is now being applied. Perhaps I didn't refresh my page enough and maybe I should have tried republishing the entire site... So now to move forward!
is working on a reply...