i have a mainpage that takes in 3 different layouts, depending on kind of page, and in each of those layouts, there is a menue, a main area, and a right column.
is it not possible to nest content areas inside another content area with regular html code around?
Yes you can use nested Templates (aka nested MasterPages) - once you've created your top level template, insert content area placeholders where you'd like the nested templates to render their markup, (there's a button in the back office to do this, and it will add standard ASP.NET ContentPlaceHolders)
To create your nested templates, right click on the parent template in the tree, and select Create, Umbraco will automatically populate the child templates with the appropate content area tags (standard ASP.NET Content tags):
now, for example, i would much rather have the menue in a Content placeholder taken somewhere else from, so that i wouldnt have to update every template on this level in structure incase i make a change to my menue!
also inside that "layout" content for content placeholder is
It is possible to have content areas inside other content areas. But changing the content inside a content area including it on a page, will "overwrite" the default content.
MasterPage2 - "ContentMaster" <%@ Master Language="C#" MasterPageFile="/masterpages/MasterPage1.master" AutoEventWireup="true" %> <asp:Content ContentPlaceHolderID="MasterTemplate" runat="server"> <asp:ContentPlaceHolder Id="Menu" runat="server"> // Default content for the menu </asp:ContentPlaceHolder> <asp:ContentPlaceHolder Id="MainContent" runat="server"> // Default content for maincontent </asp:ContentPlaceHolder> </asp:Content>
MasterPage3 - "Article" <%@ Master Language="C#" MasterPageFile="/masterpages/MasterPage2.master" AutoEventWireup="true" %> <asp:Content ContentPlaceHolderID="MainContent" runat="server"> // The content you put here will override the default content for this placeholder in MasterPage2 </asp:Content>
The first MasterPage is somewhat redundant if it doesn't contain anything else than a ContentPlaceHolder.
I use MasterPage1 to set static stuff like the doctype declaration, the whole <head></head> part and then the "MasterTemplate" contentplaceholder is placed inside the <body></body> tags. The rest is like described over.
Nested Templates
i have a mainpage that takes in 3 different layouts, depending on kind of page, and in each of those layouts, there is a menue, a main area, and a right column.
is it not possible to nest content areas inside another content area with regular html code around?
Hi Martin,
Yes you can use nested Templates (aka nested MasterPages) - once you've created your top level template, insert content area placeholders where you'd like the nested templates to render their markup, (there's a button in the back office to do this, and it will add standard ASP.NET ContentPlaceHolders)
To create your nested templates, right click on the parent template in the tree, and select Create, Umbraco will automatically populate the child templates with the appropate content area tags (standard ASP.NET Content tags):
HTH,
Hendy
Hi and Thanks for that Hendy, however
what i meant with nested is that i want several Content areas inside another content area.
for example in my mainpage i want to throw in 3 different templates depending on what design is needed
and in each of those templates, which then has a main Content placeholder with all the markup AND inside that
there is Content placeholder for a menue, and a Content placeholder for main area, and a content placeholder for right column and so on.
All that is inside the main Content area for that design, which in turn is injected into the main template.
and it doesnt seem to work!
Can you post an excerpt of your masterpages?
Certainly!
That is what the toplevel master contains right..it has a header, footer, and all other html tags.
now..layout in turn contains.
now, for example, i would much rather have the menue in a Content placeholder taken somewhere else from, so that i wouldnt have to update every template on this level in structure incase i make a change to my menue!
also inside that "layout" content for content placeholder is
while i would MUCH rather have say..as an example
but as this entire layout version ( 1 out of 3) is located inside a huge content area...i cant use other content areas inside of it?
hope that helps so i might get an answer or i will have to rethink everything.
I hope I understand you correctly.
It is possible to have content areas inside other content areas. But changing the content inside a content area including it on a page, will "overwrite" the default content.
So you can do like this:
The first MasterPage is somewhat redundant if it doesn't contain anything else than a ContentPlaceHolder.
I use MasterPage1 to set static stuff like the doctype declaration, the whole <head></head> part and then the "MasterTemplate" contentplaceholder is placed inside the <body></body> tags. The rest is like described over.
Like this:
i can't get it to work thou....
Heres the code, stripped out of markups.
as it is now i have to add the COG nav macro and settings on each template under the master template level...where i want the menue.
is working on a reply...