Copied to clipboard

Flag this post as spam?

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

  • Stephen 6 posts 96 karma points
    May 18, 2020 @ 13:27

    Preview mode breaking ContentAtRoot page urls?

    Hi folks,

    I have a site set up on Umbraco v8 and we've just noticed a very peculiar bug: if an admin has the Preview mode open in the backoffice, dynamic page URLs are being rendered as '#' even when they're accessing the site in other windows. Since our top menu uses page.URL in order to be dynamic, this means that anyone who's editing the site has severe difficulty also navigating the site unless they exit out of Preview mode first.

    Does anyone know what might be causing this?

    The code for the dynamic menu section is as follows:

                    <li><a href="/">Home</a></li>
                    @foreach (var page in Umbraco.ContentAtRoot().FirstOrDefault().Children.Where(x => !x.IsVisible()).OrderBy(x => x.SortOrder))
                        <li class="@(Model.IsAncestorOrSelf(page) ? "active" : null)">
                            <a href="@page.Url">@page.Name</a>

    Whether it's all of the page.Urls becoming # or just some of them doesn't seem to be consistent, which is also concerning.

  • Stephen 6 posts 96 karma points
    Jun 01, 2020 @ 13:21

    Has anyone else run into this? Preview mode leaking out into other windows seems like it'd be an issue that crops up with editors at least occasionally

  • Ken Burcham 9 posts 99 karma points c-trib
    Feb 25, 2021 @ 18:31
    Ken Burcham

    I just found your question because I'm having the same issue. I'm guessing that there is some other criteria we need to apply to get only published pages and not preview versions when building our menu links...

    Did you figure it out?

Please Sign in or register to post replies

Write your reply to: