Hi, I have a base template(master), main template and a footer template. The content in the footer template renders fine but not for the main template..
I've checked and rechecked countless times and cannot find any code errors, VS cannot find any errors either. Everythin is setup with the right templates and published etc.. I dont get any errors when i run the site in a browser, and umbraco don't complain either.
Funny thing is that when i remove the CPH Footer from the master template I get error in the browser, it says it cant find the CPH FooterContent, when i do the same with the main CPH nothing happens, no error at all.
Also if i change the id "MainContent" in the master template to "FooterContent" the footercontent renders fine in the main div.
Ok so ive startet from the beginning (almost) it seems i can only have one working CPH in my master template... dosent matter where it is or what it's called... i'm getting insane here..
ok sry everyone this seems to be something else... i made a masterpage contentpage website in VS and got the same error... 2 bad i didn't try that 2 days ago ;(
one content placeholder dont'n work..
Info: Umbraco 4, VS2008, ASP.NET3.5
Hi,
I have a base template(master), main template and a footer template. The content in the footer template renders fine but not for the main template..
I've checked and rechecked countless times and cannot find any code errors, VS cannot find any errors either. Everythin is setup with the right templates and published etc..
I dont get any errors when i run the site in a browser, and umbraco don't complain either.
Funny thing is that when i remove the CPH Footer from the master template I get error in the browser, it says it cant find the CPH FooterContent, when i do the same with the main CPH nothing happens, no error at all.
Also if i change the id "MainContent" in the master template to "FooterContent" the footercontent renders fine in the main div.
Hope u can help me...
//
JB
Code from the master template;
-----------------------------------------------------------
<div id="Main">
<asp:ContentPlaceHolder Id="MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="Footer">
<asp:ContentPlaceHolder ID="FooterContent" runat="server">
</asp:ContentPlaceHolder>
</div>
------------------------------------------------------------
Code from the Main template;
--------------------------------------------------
<%@ Master Language="C#" MasterPageFile="~/masterpages/BaseMasterPage.master" AutoEventWireup="true" CodeBehind="StartPageTemplate.master.cs" Inherits=asdf.asdf.masterpages.BaseMasterPage" %>
<asp:Content ContentPlaceHolderId="MainContent" runat="server">
<div id="LeftMainContainer"><umbraco:Item field="LeftMainContent" runat="server"></umbraco:Item></div>
<div id="TopRightMainContainer"><umbraco:Item field="TopRightMainContent" runat="server"></umbraco:Item></div>
<div id="BottomMiddleMainContainer"><umbraco:Item field="BottomMiddleMainContent" runat="server"></umbraco:Item></div>
<div id="BottomRightMainContainer"><umbraco:Item field="BottomRightMainContent" runat="server"></umbraco:Item></div>
</asp:Content>
---------------------------------------------------
Code from the Footer template;
-------------------------------
<%@ Master Language="C#" MasterPageFile="~/masterpages/BaseMasterPage.master" AutoEventWireup="true" CodeBehind="FooterTemplate.master.cs" Inherits="asdf.asdf.masterpages.BaseMasterPage"%>
<asp:Content ContentPlaceHolderId="FooterContent" runat="server">
<div id="LeftFooterContainer"><umbraco:Item field="LeftFooterContent" runat="server"></umbraco:Item></div>
<div id="MiddleFooterContainer"><umbraco:Item field="MiddleFooterContent" runat="server"></umbraco:Item></div>
<div id="RightFooterContainer"><umbraco:Item field="RightFooterContent" runat="server"></umbraco:Item></div>
</asp:Content>
-------------------------------
What's the code for your Base template?
Code from the master template;
-----------------------------------------------------------
<div id="Main">
<asp:ContentPlaceHolder Id="MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="Footer">
<asp:ContentPlaceHolder ID="FooterContent" runat="server">
</asp:ContentPlaceHolder>
</div>
------------------------------------------------------------
you should write ID in capitals:
<asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>
Peter
No this is the naming we use..
As for the problem it dosn't matter
@Johan, Peter means on <asp:ContentPlaceHolder tags, not the Div tags! ;)
If you look closly your tag which is function uses ID in capitols and the broken one is Id.
Hope that fixes it for you, Lau
Ahh tnx I didn't see that, unfortunately it did not fix the problem.
Ok so ive startet from the beginning (almost) it seems i can only have one working CPH in my master template... dosent matter where it is or what it's called... i'm getting insane here..
Ok so now i started a completely new installation and i still get the same error... so i suppose it has something to do with my setup.
win 7 x64
sqlexpress2008
VS2008
And i run umbraco from a VS directory not under iis7.. Any ideas?
Are you wrapping your entire masterpage in a CPH, as below? L
Yes ive gone down to the very basics and this is what i have now.. still doesn't work.. and I dont use VS anymore
-----------------Master file
<%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<asp:ContentPlaceHolder Id="main" runat="server">
<!-- Insert default "main" markup here -->
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder Id="foot" runat="server">
<!-- Insert default "foot" markup here -->
</asp:ContentPlaceHolder>
</asp:Content>
------------------Main file
<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="main" runat="server">
<umbraco:Item field="main" runat="server"></umbraco:Item>
</asp:Content>
------------------Footer file
<%@ Master Language="C#" MasterPageFile="/masterpages/Master.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="foot" runat="server">
<umbraco:Item field="foot" runat="server"></umbraco:Item>
</asp:Content>
ok sry everyone this seems to be something else... i made a masterpage contentpage website in VS and got the same error... 2 bad i didn't try that 2 days ago ;(
anyway tnx for trying to help.
Hi Johan!
Have you tried to set "recursive=true" for your umbraco field for your footer?
--
Björn
is working on a reply...