How to load ContentPlaceHolders from Master.Master Page, not Templates?
Basically, in Umbraco 4.7.1, I was able to load Master.Master file from root of Umbraco site, and just put the following code in all template files in Umbraco: Settings->Templates:
Than in the Master Page on the root: Master.Master (not sure where that was defined at), I just had my content placeholders defined, where all of my Template Files (also, in the root of Umbraco Site) would call those *ContentPlaceHolder IDs in an <asp:Content /> element. Installing Umbraco 7.1 does not want to work like this. In Umbraco 7.1, I have the following code in my templates in Settings -> Templates:
I have no Master Templates defined in Umbraco (which is the same setup I had for 4.7.1, that worked in that version). In the root of the site, I have All Template Alias's (from Umbraco for each template), defined as TemplateHome.aspx, and TemplateHome.aspx.cs (which also worked in umbraco 4.7.1), than I have the Master.Master file in the root of the site with the following ContentPlaceHolders defined in it (where each .aspx file, connects to with <asp:Content /> elements:
Master.Master ContentPlaceHolders:
<asp:ContentPlaceHolder ID="TheDocTypeContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>
<head>
<!--// Global Stuff in here... //-->
<asp:ContentPlaceHolder ID="TheHeadContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>
</head>
<body>
<!--// Conditional Stuff in here... //-->
<asp:ContentPlaceHolder ID="TheContentPlaceHolder" runat="server" />
</body>
</html>
How to set this up so that All ContentPlaceholders are used from the Master.Master file in the sites root?? If I put in the following Code, it loads up the Master.Master file... but does not load up any of the Content from the .aspx files (Where the .aspx file is the same as the Template Alias Name, if that even matters):
So, basically, all ContentPlaceHolders do not render from this page at all.... Why? Like I said, this rendered fine in Umbraco 4.7.1, just not happening in 7.1. What must I do to get this connected properly in Umbraco 7.1?
Also, I have edited the Umbraco.config to use as Webforms, not Mvc (though, it doesn't matter what I do, cause it still doesn't work in either way).
In Umbraco 4.7.1, there was ASP.NET MasterPages automatically Enabled. Not sure if this is an option in Umbraco 7.1, but could possibly be needed??
Umbraco 7 works in MVC by default, but you can change this. After you set the mode from MVC to WebForms in umbraco.config you must recycle the application pool so that the changes are applied.
When loading up the Main Site, I get a Blank Page. Umbraco.config was changed to WebForms yesterday, so the recycling of the Application Pool should be fine I would think. Is there something else I am missing here? I just get Blank Page, how to debug this?
Basically, I created new Template:
Name = HomeTemplate
Alias = TemplateHome
Master = none
Put in the following code above. How do I load up my Master.Master file to include TemplateHome.aspx and TemplateHome.aspx.cs?
it is normal if you get a blank page in frontend with the code above. You have no html code inside the ContentPlaceHolderDefault which can be rendered. Do you have at least one node in content section? Do you have assign the home template to your content node and have published this node after assign?
It's a long time ago when I was working with WebForms. I work only with MVC since Umbraco 7.1 is out. But the procedure with WebForms is exactly the same as before in Umbraco 4.
Yes, it is using the Home Document Type that I created.
Do you have assign the home template to your content node and have published this node after assign?
Yes Again.
How to load up the Master.Master file into the Content element ContentPlaceHolderDefault? Or bypass this template thing altogether and just load up the Master.Master file instead?
And now getting a 404, Template Not Found Error. Went back to republish the Homepage, and reload the Homepage, and still get Template Not Found 404 Error, this page is intentionally left ugly... etc. etc.
How to load ContentPlaceHolders from Master.Master Page, not Templates?
Basically, in Umbraco 4.7.1, I was able to load Master.Master file from root of Umbraco site, and just put the following code in all template files in Umbraco: Settings->Templates:
Than in the Master Page on the root: Master.Master (not sure where that was defined at), I just had my content placeholders defined, where all of my Template Files (also, in the root of Umbraco Site) would call those *ContentPlaceHolder IDs in an
<asp:Content />
element. Installing Umbraco 7.1 does not want to work like this. In Umbraco 7.1, I have the following code in my templates in Settings -> Templates:I have no Master Templates defined in Umbraco (which is the same setup I had for 4.7.1, that worked in that version). In the root of the site, I have All Template Alias's (from Umbraco for each template), defined as TemplateHome.aspx, and TemplateHome.aspx.cs (which also worked in umbraco 4.7.1), than I have the Master.Master file in the root of the site with the following ContentPlaceHolders defined in it (where each .aspx file, connects to with
<asp:Content />
elements:Master.Master ContentPlaceHolders:
How to set this up so that All ContentPlaceholders are used from the Master.Master file in the sites root?? If I put in the following Code, it loads up the Master.Master file... but does not load up any of the Content from the .aspx files (Where the .aspx file is the same as the Template Alias Name, if that even matters):
So, basically, all ContentPlaceHolders do not render from this page at all.... Why? Like I said, this rendered fine in Umbraco 4.7.1, just not happening in 7.1. What must I do to get this connected properly in Umbraco 7.1?
Also, I have edited the Umbraco.config to use as Webforms, not Mvc (though, it doesn't matter what I do, cause it still doesn't work in either way).
In Umbraco 4.7.1, there was ASP.NET MasterPages automatically Enabled. Not sure if this is an option in Umbraco 7.1, but could possibly be needed??
Hi Solomon,
Umbraco 7 works in MVC by default, but you can change this. After you set the mode from MVC to WebForms in umbraco.config you must recycle the application pool so that the changes are applied.
Sören
Ok, so I have just recycled the Application Pool, just now. Reloading the Page still shows Blank Page... HomeTemplate has the following code in it:
When loading up the Main Site, I get a Blank Page. Umbraco.config was changed to WebForms yesterday, so the recycling of the Application Pool should be fine I would think. Is there something else I am missing here? I just get Blank Page, how to debug this?
Basically, I created new Template:
Put in the following code above. How do I load up my Master.Master file to include TemplateHome.aspx and TemplateHome.aspx.cs?
Hi Solomon,
it is normal if you get a blank page in frontend with the code above. You have no html code inside the ContentPlaceHolderDefault which can be rendered. Do you have at least one node in content section? Do you have assign the home template to your content node and have published this node after assign?
Sören
It's a long time ago when I was working with WebForms. I work only with MVC since Umbraco 7.1 is out. But the procedure with WebForms is exactly the same as before in Umbraco 4.
Yes, it is using the Home Document Type that I created.
Yes Again.
How to load up the Master.Master file into the Content element ContentPlaceHolderDefault? Or bypass this template thing altogether and just load up the Master.Master file instead?
Now, I just tried to put something in between the
<Content />
element, like this:And now getting a 404, Template Not Found Error. Went back to republish the Homepage, and reload the Homepage, and still get Template Not Found 404 Error, this page is intentionally left ugly... etc. etc.
I have been battling with this for 2 days now. Anyone out there can help please?
is working on a reply...