Copied to clipboard

Flag this post as spam?

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


  • Jon 23 posts 53 karma points
    Apr 15, 2015 @ 13:42
    Jon
    0

    Links seem to be stacking ontop of eachother making the website unusable

    Hi,

     

    For some reason my links in my site are stacking ontop of eachother, so for example if I navigate here:

    http://localhost:3489/news-overview/neo-systems/

    And then hit the Home button to return the home page then Umbraco will navigate here:

    http://localhost:3489/news-overview/neo-systems/home

    Which goes no where as this page doesn't exist.

     

    What could be the cause of this?

     

    I've basically copied the news posting system from the Umbraco samples for this.

     

    Thanks,

    Jon

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 15, 2015 @ 13:43
    Jan Skovgaard
    0

    Hi Jon

    Any chance that you can provide links that are accessible to us on www? Those above are for your local machine only :)

    Perhaps a screendump and a snippet of your CSS code is enough to provide some hints though.

    Looking forward to hearing from you.

    /Jan

  • Jon 23 posts 53 karma points
    Apr 16, 2015 @ 12:18
    Jon
    0

    Hi Jan,

     

    Thanks for the response! :) I can't provide an external link yet unfortunately. I was providing an example of what happens with the directory structure. 

     

    So here is snippet of my NewsItem page which lives under NewsOverview:

     

    @inherits UmbracoTemplatePage
    @{
        Layout = "Master.cshtml";
    
        // If the editor has not explicitly provided the "Page title" property page 
        // then just show the name of the page otherwise show the provided title
        var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
            ? CurrentPage.Name
            : CurrentPage.Title;
    }
    <link href="@Url.Content("~/~/css/style-news.css")" rel="stylesheet" type="text/css" media="all" />
    
    
     
    News Overview:
    @inherits UmbracoTemplatePage
    @{
        Layout = "Master.cshtml";
    
        // If the editor has not explicitly provided the "Page title" property page 
        // then just show the name of the page otherwise show the provided title
        var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
            ? CurrentPage.Name
            : CurrentPage.Title;
    
        // Model.Content is the current page that we're on
        // AncestorsOrSelf is all of the ancestors this page has in the tree
        // (1) means: go up to level 1 and stop looking for more ancestors when you get there
        // First() gets the first ancestor found (the home page, on level 1)
        var homePage = CurrentPage.AncestorsOrSelf(1).First();    
    
        // Find all pages with document type alias umbNewsOverview
        // We do that using the plural, umbNewsOverviews (note the extra "s" in the end)
        // Then take the first one, as we know there will only be on news overview page
        var newsOverview = homePage.umbNewsOverviews.First();
    
        // Similar to above: find all pages with document type umbNewsItem under the news overview page
        // Then order them, first by publishDate (a property the editor can explicitly set on the news item)
        // and then by createDate, which is set by Umbraco automatically when a page gets created.
        var newsItems = newsOverview.umbNewsItems.OrderBy("publishDate desc, createDate desc").Take(5);
    
    }
    <link href="@Url.Content("~/~/css/style-news.css")" rel="stylesheet" type="text/css" media="all" />
    
    
     
    I didn't think my CSS would affect this?
     
    So I have a Master template file, and everything lives under that. The Master template has most of the links in it configured in the backend.
     
     
    Cheers,
    Jon
  • Jon 23 posts 53 karma points
    Apr 17, 2015 @ 11:44
    Jon
    0

    Ah I figured out what the problem was for most of the links. Very simple as usual haha. Adding a "/" before the link name so "/contact" rather than just "contact" or "contact/".

     

    Thanks!

    Jon

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 17, 2015 @ 14:44
    Jan Skovgaard
    0

    Hi Jon

    Missed your post yesterday but happy to read that you managed to figure out the issue :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft