Copied to clipboard

Flag this post as spam?

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


  • Nadir Talic 5 posts 36 karma points
    Mar 04, 2021 @ 12:28
    Nadir Talic
    0

    All links to Content pages end up opening HomePage

    Recently I did a fresh install of Umbraco 8 (version 8.11.1) and did some work, but I'm having trouble with routing. I added couple of pages using ContentPage document type but after setting up menu links, I always end up on HomePage, regardless of what link I click.

    Same goes for footer links, as well as buttons.

    At first I suspected something went wrong when I did bilingual setup, but domains are set correctly, and separate menu is created for both languages.

    The odd thing is that this is happening only when I use ContentPage document type. I also did samo portfolio setup, and links to those pages work as expected.

    I'm not sure if I'm doing something wrong, or it's some other issues.

  • Sotiris Filippidis 286 posts 1501 karma points
    Mar 04, 2021 @ 12:30
    Sotiris Filippidis
    100

    I've had this incident reported once more, but I'm not sure it was for the same reasons.

    Can you please check that your Content Pages have the "ContentPage" template assigned? Also, what do the links point to originally? Finally, can you clear your Umbraco memory cache?

  • Nadir Talic 5 posts 36 karma points
    Mar 04, 2021 @ 13:08
    Nadir Talic
    0

    ContentPage template was indeed missing (altogether), so I added new template and assigned it to ContentPage document type as default template.

    Following is project structure enter image description here

    And ContentPage temlate is

    @using Site.Core;
    @inherits Umbraco.Web.Mvc.UmbracoViewPage<PageContent>
    @{
        Layout = "siteTemplate.cshtml";
        PageContent currPage = Model;
    
        //Pass a value to push down content a bit if no background image is set.
        bool pushDown = (!(new PageHeaderUtils(currPage).HasHeaderImage)) && !currPage.IntroSection.Any();
    
        string culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
    }
    
    @Html.Action(MVC.PageBackgroundImage.ActionNames.Index, MVC.PageBackgroundImage.Name, new { culture = culture })
    
    @if (pushDown)
    {
        <div class="spacer-75"></div>
    }
    
    <main id="main">
        @Html.Partial(MVC.Shared.Views.Common._PageBlockRenderer, currPage)
    </main>
    

    As far as links go, they are relative links (i.e. /en/services), and Menu is not generated but created manually.

    I'm currently running this on IIS Express through VS Code.

  • Nadir Talic 5 posts 36 karma points
    Mar 04, 2021 @ 13:18
    Nadir Talic
    0

    Got it to work finally...

    It was missing ContentPage template in addition to some of the pages missing custom domains for bilingual routing.

    Thanks!!!

  • Sotiris Filippidis 286 posts 1501 karma points
    Mar 04, 2021 @ 13:38
    Sotiris Filippidis
    0

    My worry is why did this happen. Did the content page template go missing from something you did, or was it missing from the start? This would be useful to know in case this happens on package install for some reason (hasn't happened to me, but it could be a version-specific issue)

  • Nadir Talic 5 posts 36 karma points
    Mar 04, 2021 @ 13:53
    Nadir Talic
    1

    It was missing from the start.

    And how do I know you might ask :).

    I know because I tend to browse the settings prior to beginning any new work, just to have some high level overview and basic knowledge of how stuff works for just in case something goes wrong :)

  • Sotiris Filippidis 286 posts 1501 karma points
    Mar 04, 2021 @ 13:56
    Sotiris Filippidis
    0

    Thanks for the info! I'll be sure to check what's going on and release a fix if necessary!

Please Sign in or register to post replies

Write your reply to:

Draft