- This topic has 22 replies, 3 voices, and was last updated 4 years ago by Tom.
-
AuthorPosts
-
April 19, 2020 at 7:15 am #1245296Carsten
Hi there, I have added an element to my secondary nav menu element, with a span class=”count” which I want displayed as well.
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
April 19, 2020 at 7:38 am #1245315CarstenThe nav menu items also is listed with dots, why?
April 19, 2020 at 9:00 am #1245529LeoStaffCustomer SupportHi there,
Where can I see that element?
How are you adding it?
April 19, 2020 at 9:23 am #1245563CarstenHi, 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>
April 19, 2020 at 5:13 pm #1245964TomLead DeveloperLead DeveloperHi 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 🙂
April 19, 2020 at 5:26 pm #1245971CarstenHi there, sorry, but this markup only displays a dot.
April 20, 2020 at 9:31 am #1246912TomLead DeveloperLead DeveloperIs there a specific page where I can see this?
Are you trying to add it as a regular menu item?
April 20, 2020 at 9:50 am #1246929CarstenYou can see it on the landing page now.
Yes, I am trying to add it as a menu item
Thanks
April 20, 2020 at 5:05 pm #1247297TomLead DeveloperLead DeveloperCan you show me exactly where you want it? Next to the mobile menu 3 bars? Inside the off canvas panel?
April 21, 2020 at 4:10 am #1247699CarstenSorry 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:
April 21, 2020 at 10:24 am #1248284TomLead DeveloperLead DeveloperAnd you’re wanting this HTML to render in the white bar with the current “Menu” item with the 3 bars?
April 21, 2020 at 11:52 am #1248398CarstenIn 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
April 21, 2020 at 4:19 pm #1248600TomLead DeveloperLead DeveloperSo 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?
April 21, 2020 at 5:01 pm #1248612CarstenThanks for trying, the only change is that the dot is now contained
April 22, 2020 at 9:22 am #1249504TomLead DeveloperLead DeveloperYou 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; }
-
AuthorPosts
- You must be logged in to reply to this topic.