[Resolved] Adding elements to a Sub Nav Element

Home Forums Support Adding elements to a Sub Nav Element

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #1245296
    Carsten

    Hi there, I have added an element to my secondary nav menu element, with a span class=”count” which I want displayed as well.

    View post on imgur.com

    Here is the markup I use:

    <li id="messages-personal-li" ><a id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button"><a href="https://domain/members/me/messages/">Beskeder <span class="count"></span></a></li>

    This is a copy of the element from the inspector:

    <li id="messages-personal-li"><a id="user-messages" href="https://domain/members/me/messages/">Beskeder <span class="count">10</span></a></li>

    The “count” is not displayed. Is this not possible to achieve, or is my markup wrong?

    Thanks in advance

    #1245315
    Carsten

    The nav menu items also is listed with dots, why?

    View post on imgur.com

    #1245529
    Leo
    Staff
    Customer Support

    Hi there,

    Where can I see that element?

    How are you adding it?

    #1245563
    Carsten

    Hi, I’m adding it to a hook element for a secondary nav menu.

    I received this markup example from David, which is working fine, which I use as reference for adding other elements. It is working fine except from the count and the listing dots.

    <li id="menu-item-1391" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-1391 button">
        <a href="https://some-site.com/some-page">Søg</a>
    </li>
    #1245964
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Your HTML in the initial post is broken:

    <li id="messages-personal-li" >
        <a id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button">
            <a href="https://domain/members/me/messages/">Beskeder <span class="count"></span>
        </a>
    </li>

    Try this:

    <li id="messages-personal-li" >
        <a href="https://domain/members/me/messages/" id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button">
            Beskeder <span class="count"></span>
        </a>
    </li>

    Let me know 🙂

    #1245971
    Carsten

    Hi there, sorry, but this markup only displays a dot.

    #1246912
    Tom
    Lead Developer
    Lead Developer

    Is there a specific page where I can see this?

    Are you trying to add it as a regular menu item?

    #1246929
    Carsten

    You can see it on the landing page now.

    Yes, I am trying to add it as a menu item

    Thanks

    #1247297
    Tom
    Lead Developer
    Lead Developer

    Can you show me exactly where you want it? Next to the mobile menu 3 bars? Inside the off canvas panel?

    #1247699
    Carsten

    Sorry for the confusion of having both a secondary menu and a sub menu element, which was to show how I want my secondary menu hook element to look like: Three links contained and centered.

    Why I’m going with the hook element solution, is because I want the activity count next to the message tab.

    <li id="messages-personal-li" >
        <a href="https://domain/members/me/messages/" id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button">
            Beskeder <span class="count"></span>
        </a>
    </li>

    With this code added, it looks like this:

    View post on imgur.com

    #1248284
    Tom
    Lead Developer
    Lead Developer

    And you’re wanting this HTML to render in the white bar with the current “Menu” item with the 3 bars?

    #1248398
    Carsten

    In the light gray secondary menu element, for some reason it is not visible on the landing page, but you can see it here domain/frontpage

    View post on imgur.com

    #1248600
    Tom
    Lead Developer
    Lead Developer

    So what if you do this in the Hook Element:

    <div class="grid-container sub-navigation grid-parent">
        <ul>
            <li id="messages-personal-li" >
                <a href="https://domain/members/me/messages/" id="user-messages" class="menu-item menu-item-type-post_type menu-item-object-post messages-personal-li button">
            Beskeder <span class="count"></span>
                </a>
            </li>
        </ul>
    </div>

    Any improvement?

    #1248612
    Carsten

    Thanks for trying, the only change is that the dot is now contained

    View post on imgur.com

    #1249504
    Tom
    Lead Developer
    Lead Developer

    You have this CSS added to your site:

    a#user-messages {
        display: none !important;
    }

    You’ll need to remove that CSS, or remove that ID from the <a> element.

    Then you can add this CSS:

    .sub-navigation ul {
        list-style-type: none;
        margin: 0;
    }
Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.