Copied to clipboard

Flag this post as spam?

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


  • strawberrylatte 34 posts 103 karma points
    Mar 02, 2021 @ 06:56
    strawberrylatte
    0

    how to set doctype with no template with no link

    how do I make a parent node to not have any url

  • Michiel Schoofs 5 posts 85 karma points
    Mar 02, 2021 @ 11:26
    Michiel Schoofs
    0

    As far as I'm aware all published content automatically gets assigned a URL. There is a couple of ways to deal with it depending on which you find more preferable:

  • Jonas Boman 8 posts 48 karma points
    Mar 03, 2021 @ 07:47
    Jonas Boman
    0

    The parent node will always have an url. If the page should not be accessed you could set up a redirect for that url, leading to other page.

  • strawberrylatte 34 posts 103 karma points
    Mar 04, 2021 @ 02:02
    strawberrylatte
    0

    i would like for the parent node to redirect to # instead. This is my bit of code

    @{
                                            var root = Model.Value<IPublishedContent>("sidebarRootNode", fallback: Fallback.ToAncestors);
    
                                            if (root != null)
                                            {
                                                foreach (var child in root.Children)
                                                {
                                                    <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-5818 @(Model.Url == child.Url ? "current-menu-item" : null)" style="display: flex; justify-content: space-between">
                                                        <a href="@child.Url">@child.Name</a>
                                                        @if (child.Children.Any() && !child.IsDocumentType("people"))
                                                        {
                                                            <button href="#" onclick="toggleChildMenu('[email protected]', this)" style="cursor: pointer; background: none; border: none; padding: 0 1rem; font-size: 1rem; color: rgb(140, 140, 140)">
                                                                <i class="fa fa-chevron-down" aria-hidden="true"></i>
                                                            </button>
                                                        }
                                                    </li>
                                                    if (child.Children.Any() && !child.IsDocumentType("people")) // don't show child nodes of people
                                                    {
                                                        <li id="[email protected]" style="border: none; display: none;">
                                                            <ul style="margin-left: 1rem; margin-bottom: 0;" class="gdlr-core-custom-menu-widget gdlr-core-menu-style-list">
                                                                @foreach (var child2 in child.Children)
                                                                {
                                                                    <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-5818 @(Model.Url == child2.Url ? "current-menu-item" : null)">
                                                                        <a href="@child2.Url">@child2.Name</a>
                                                                    </li>
                                                                }
                                                            </ul>
                                                        </li>
                                                    }
                                                }
                                            }
                                        }
    
Please Sign in or register to post replies

Write your reply to:

Draft