This seems odd, as Umbraco.Field should not be recursive by default I think. You could always try:
@Umbraco.Field("siteName", recursive: false)
...just to be sure.
Failing that it would seem there's something not quite right with your templates - I'd double check where the 'home' value is being rendered and make sure it's not something that's been mis-configured.
If you're still banging your head against a wall, then please post the top parts of your templates (home and one other, and a master template if you're using one for example) and someone might be able to point you to a solution.
The only thing I can think of, and it's a long shot, is that your sub-pages don't have templates correctly assigned to them, so when you're viewing http://www.yoursite.com/sub-page it's actually rendering the homepage with the sub-page template, rather than the sub-page itself (Umbraco does this - look up 'altTemplate' for more info). So, to check this, go to the content section and check that there's a template assigned to all of your pages in the 'Properties' tab of each page.
Aside from that, PRK's suggestion above would be a good way to try to debug.
Page Title
I have created a layout page and below that i have created 4 different layouts home/contact/portfolio/about.
They each have their own document type.
I then go into the content and add them individually.
Inside the template for layout I insert a field in the title tags "@Umbraco.Field("pageName")".
This works fine for the home page. But when i navigate to any of the other pages the title is still "Home".
Why would this be?
Hi James,
This seems odd, as Umbraco.Field should not be recursive by default I think. You could always try:
...just to be sure.
Failing that it would seem there's something not quite right with your templates - I'd double check where the 'home' value is being rendered and make sure it's not something that's been mis-configured.
If you're still banging your head against a wall, then please post the top parts of your templates (home and one other, and a master template if you're using one for example) and someone might be able to point you to a solution.
Inside my master doc template i put a field called Page Title (pageTitle). This is different for each home/ about content when i edit them.
I use a master layout called layout:
@inherits UmbracoTemplatePage
@{
Layout = null;
}
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<title>@Umbraco.Field("pageTitle", recursive: false)</title>
Here is my home page template:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Layout.cshtml";
}
and here is my about page template:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Layout.cshtml";
}
Nothing different between the templates that are inside of the layout template.
I did try:
<title>@Umbraco.Field("pageTitle", recursive: false)</title>
To no avail :(.
Hope somone can see where I am going wrong. I created this site from a blank umbraco instance.
Thanks.
Hi James,
I dont know why it fails, but You could also try:
The only thing I can think of, and it's a long shot, is that your sub-pages don't have templates correctly assigned to them, so when you're viewing http://www.yoursite.com/sub-page it's actually rendering the homepage with the sub-page template, rather than the sub-page itself (Umbraco does this - look up 'altTemplate' for more info). So, to check this, go to the content section and check that there's a template assigned to all of your pages in the 'Properties' tab of each page.
Aside from that, PRK's suggestion above would be a good way to try to debug.
Its my fault, in the navigation of the master template i was putting my links as:
"/AboutPage" which is the template not the content page.
Changed it to:
"/about"
"/home"
And now its rendering individual content pages.
Thanks very much for the input. Me being silly.
is working on a reply...