Copied to clipboard

Flag this post as spam?

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


  • Greg Jenson 24 posts 157 karma points
    Jun 04, 2018 @ 02:03
    Greg  Jenson
    0

    Basic Query Builder and Navigation - why is this happening

    Can anyone tell me what's happening here? I've created my navigation using the query builder:

    <ul id="nav-ul" class="menu font-montserrat-reg clearfix">
                            <li class="menu-item"><a href="~/">HOME</a></li>
                            @{
                                var selection = Model.Content.Site().Children().Where(x => x.IsVisible());
                            }
                                @foreach(var item in selection){
                                    <li class="menu-item">
                                        <a href="@item.Url">@item.Name</a>
                                    </li>
                                }
                        </ul>
    

    This generates the menu just fine, and the @item.Url is pointing to the correct page, e.g. /news/. BUT, when the page loads, it's loading without the css. If I manually remove the final '/' from the address bar (/news), the page loads correctly.

    What am I missing?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jun 04, 2018 @ 06:48
    Alex Skrypnyk
    101

    Hi Greg

    Check, please, how css was included to the page?

    I think it will be right place to fix - change css path, then it will work on all pages.

    Thanks,

    Alex

  • Greg Jenson 24 posts 157 karma points
    Jun 05, 2018 @ 05:42
    Greg  Jenson
    0

    Here's to hoping that all of my future questions are this easy to answer. Old link: <link href="css/style.css" rel="stylesheet" type="text/css" /> New link: <link href="~/css/style.css" rel="stylesheet" type="text/css" /> Problem solved. Still trying to figure out how I missed this, but thanks for the tip.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies