Copied to clipboard

Flag this post as spam?

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


  • Joe Morrison 20 posts 80 karma points
    Sep 02, 2012 @ 03:11
    Joe Morrison
    0

    nested page not found bug

    Hi Guys,

    Updating my website after a long while butI seem to hit a sticking point.  I have the following structure:

    Home > Blog > Blog Item, when running in localhost/blog/ displays fine hower, localhost/blog/item1 brings a page not found error.

    I have the following razor macro which lists all my blog pages on the home page to generate the link, which works, grabs all each items data, except oddly the link for the page itself generates the dreaded "not found" demon:

    @inherits umbraco.MacroEngines.DynamicNodeContext

    @{    // Get the Homepage Node
            var rootNode = @Model.AncestorOrSelf(1);

            // Get the News Page Node (Assuming there is only one)
            var blogNode = rootNode.DescendantsOrSelf()
                    .Where("NodeTypeAlias == \"Blog\"")[0];
            
        // Get the News List
        var blogList = blogNode.Children
            .Where("NodeTypeAlias == \"BlogItem\"");
            
        var maxItems = 3;
    }

                    @for (int i = 0; i < maxItems; i++)
                    {
          <a href="@umbraco.library.NiceUrl(blogList[i].Id)">
            <section class="cp">
                <article> <img class="blogImg" alt="" src="@Html.Raw(@blogList[i].MediaById(@blogList[i].blogTeaserImage).umbracoFile)"/>
                  <section class="blogSynopsis">
                    <h5>@blogList[i].blogItemTitle </h5>
                    <p>
                               
                     @Library.Truncate(@blogList[i].blogItemSynopsis,75)
                    
                    </p>
                  </section>
                </article>
              </section>          
            </a>
                     }

    Running locally on IIS7.5 , Windows Premium, SQL Server 2008 R2

    This is my first post asking for help so please let me know if you need any other details.

    Regards,

    Joe

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 02, 2012 @ 07:24
    Fuji Kusaka
    0

    Hi Joe,

    If you view the generated source are you actually getting the right url? What happens if you click on the "link to document" in your Properties Tab? Do you get page not found?

     

  • Joe Morrison 20 posts 80 karma points
    Sep 02, 2012 @ 09:51
    Joe Morrison
    0

    Hi Fuji,

     

    Thanks for the reply! Yes I am getting <a href="/blog/item1/">  - This reflects the link provided by "link to document" in properties. However following this generates the same page not found error.

     

    No umbraco document matches the url 'http://localhost/blog/item1/'

    umbraco tried this to match it using this xpath query'/root/*/* [@urlName = "blog"]/* [@urlName = "item1"] | /root/* [@urlName = "item1"]')

     

    Previewing before publishing an amend also generates a blank page, with blank source.

    I should also point out I'm using v4.8.1

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 02, 2012 @ 10:41
    Fuji Kusaka
    0

    Weird can you republish the whole website and see if all your nodes "Blog Items" are still present? Under the Settings section can you also see if all the docTypes are present.

    I havent used v4.8.1 yet but came across something similar in the past where i accidently deleted a docType.

  • Joe Morrison 20 posts 80 karma points
    Sep 02, 2012 @ 10:59
    Joe Morrison
    0

    Hey thanks for the advice but still no joy, Nodes are still present after republishing, and my docTypes are still present.

    I am now worried however as when setting up the doctypes I did delete (stupidly) and recreate them (rather than copy) as I had initially gotten them in the wrong structure. Could this be the issue?

     

  • Joe Morrison 20 posts 80 karma points
    Sep 02, 2012 @ 17:33
    Joe Morrison
    0

    Just to update, this appears to be a node issue, I set up in a new instance - (this time without deleting and replacing docTypes) and works as expected.

    Thanks for the help though and helping me wittle down the problem!

    J

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 02, 2012 @ 20:04
    Fuji Kusaka
    0

    Hi Joe,

    Sorry for replying now only. I must have been something to do with the Document Type, but glad you got it working though.

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft