Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all.I'm on the beginning of my Umbraco journey...
I'm trying to create nested templates. I have 3 levels. I cannot get the 3rd level to work.I have no idea what I'm doing wrong. I saw all the Umbraco TV and tutorials and search the web for an answer.Here is my stracture and code. Any help would be appriciated.
Document Types=============master |--> Homepage |--> News List |--> News Item
master |--> homepage |--> News List
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <link href="/css/style.css" rel="stylesheet" type="text/css"> <link href="/css/cssmenu.css" rel="stylesheet" type="text/css"> </head> <body> <!-- HEADER --> <umbraco:Macro Alias="HeaderImage" runat="server"></umbraco:Macro> <!-- HEADER --> <!-- MENU --> <umbraco:Macro Alias="TopNavigation" runat="server"></umbraco:Macro> <!-- MENU --> <!-- Breadcrumbs --> <umbraco:Macro Alias="Breadcrumbs" runat="server"></umbraco:Macro> <!-- Breadcrumbs --> <!-- BODY --> <asp:ContentPlaceHolder id="ContentPlaceHolderPage" runat="server" /> <!-- BODY --> </body> </html></asp:Content>
<%@ Master Language="C#" MasterPageFile="~/masterpages/TaroIl.master" AutoEventWireup="true" %><asp:Content ContentPlaceHolderID="ContentPlaceHolderPage" runat="server"> <umbraco:Item field="bodyText" runat="server"/> <!-- News --> <asp:ContentPlaceHolder id="ContentPlaceHolderNewsList" runat="server" /> <!-- News --></asp:Content>
mews list template================================================================================
<%@ Master Language="C#" MasterPageFile="~/masterpages/HomePage.master" AutoEventWireup="true" %><asp:Content ContentPlaceHolderId="ContentPlaceHolderNewsList" runat="server"> News 1 News 2 News 3</asp:Content>
When I run the site, homepage template work. But not the news list template.
In fact I dont get error message ate all even if I change the id of the asp:ContentPlaceHolder in the homepage template to reference a content id that does not exists...Umbraco simply ignore the asp:ContentPlaceHolder in the homepage template.
Thanks for any help.
So you have a news page which has the news list template as it's template? Your code looks good, so perhaps it something else. The homepage shouldn't show any news because if it has the homepage template and not the new list template. If you want to show news on the homepage you should use a macro for that.
I was following this Umbraco TV guide in making the news list. This is why I made it in a seperate template and pages...Only in my case I tried to nest the news list to the homepage.Only the homepage will display news, so it make sense to me that news list will be nested to homepage.
It also better to understand in the content section (the tree view will look: homepage --> news list -->news items).
by the way, I'm using a macro, but it resides in the news list template which is being ignored (i didn't wrote the macro here to simplify)
I don't know if this is a bug or code error, all guides and tutorials are saying that I can nest as many templates as I want...
The symptoms you are describing sound like you are only utilising the homepage template. Is it possible that when you say you are testing the news list template, this is not the template which is been used? Which template the page uses is configured in the "Content" section and is found under the "Properties" tab of the page you are trying to test with.
If the template does not appear in the dropdown list, these are configured under the "Document Types" of the "Settings" section.
I have written an article on Umbraco Template some time back which may help get to grips with the basics, however if I am correct, you have the template part figured out, it's just how to utilise them which is the missing piece of the puzzle:
Thanks Richard and Jeroen
I think some chips has fallen.
It would be complicated for me to explain in writing but I think I better understand why what I tried to do didn't work.
In general, I thought that the nested template would show the 3rd level page content when I'm surfing the 2nd level page.This is not the case in Umbraco apparently...
I'm doing the News macro in the homepage template now, and not on a nested 3rd level template, so all is working.
Now I face the same problem. Nothing appear at Level 3.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted