Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James 251 posts 1169 karma points
    Jul 17, 2014 @ 11:42
    James
    0

    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?

  • Dan 1288 posts 3921 karma points c-trib
    Jul 17, 2014 @ 13:44
    Dan
    0

    Hi James,

    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.

  • James 251 posts 1169 karma points
    Jul 17, 2014 @ 14:10
    James
    0

    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.

  • PRK 47 posts 119 karma points
    Jul 17, 2014 @ 14:41
    PRK
    1

    Hi James,

    I dont know why it fails, but You could also try:

    <title>@CurrentPage.GetPropertyValue("YourProperty")</title>
    
  • Dan 1288 posts 3921 karma points c-trib
    Jul 17, 2014 @ 14:51
    Dan
    101

    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.

  • James 251 posts 1169 karma points
    Jul 17, 2014 @ 21:42
    James
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft