Copied to clipboard

Flag this post as spam?

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


  • Nathan Rogan 22 posts 203 karma points
    Nov 03, 2023 @ 12:03
    Nathan Rogan
    0

    Check if Block List is null

    Hi,

    Does anyone know if there's a way of checking if a blocklist is null? I'm using it to create multi level navigation:

    <div id="primary-menu-container" class="ds-mega-menu__container">
            <div class="ds-container">
                <ul class="ds-mega-menu__sub-menu ds-mega-menu__sub-menu--has-child-menus">
                    @Html.GetBlockListHtml(content.ChildLinks)
                </ul>
            </div>
    </div>
    

    I want to hide this div if theres no child links

    Thanks

  • Nathan Rogan 22 posts 203 karma points
    Nov 03, 2023 @ 12:07
    Nathan Rogan
    100

    Figured it out. You can use Count e.g. @content.ChildLinks.Count

  • 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