Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Sub menu in quark open

Solved by pamtbaau View solution

Started by Dave Torchia 8 years ago · 10 replies · 2016 views
8 years ago

Hi, I want to create a submeni...for example under the text "my name" i want to show two pages "who am i" and "my story"...but i don't know how can i create a sub menu...because whan i add a new page under the menu, the new page is not visible...

8 years ago

@semplicewebsite Would you mind sharing what you have done and share your folder structure?

8 years ago

When i click on the menu voice i wanna only show the sub menu and not the page

8 years ago Solution

Ah thanks! That makes it so much easier to help you....

  1. First create your own inherited theme from Quark. If not you will loose your changes when Quark gets updated.
  2. Copy file '/user/themes/quark/templates/partials/navigation.html.twig' into your own theme.
  3. In your own version of 'navigation.html.twig' change the following:
    TWIG
    {% if p.children.visible.count > 0 %}
      <li>
          <a href="{{ p.url }}" class="{{ active_page }}">     <- To be changed
    

    into:

    TWIG
    {% if p.children.visible.count > 0 %}
      <li>
          <a class="{{ active_page }}">     <- Removed the attribute 'href'
    

Hope this helps...

👍 1
last edited 08/28/18 by pamtbaau
8 years ago

I have change the quark open
<a class="{{ active_page }}">
{% if not((hide_home_menu_link) and (p.slug in home_alias)) %}

TWIG
    {% set active_page = (p.active or p.activeChild) ? 'active' : '' %}
    {% if p.children.visible.count > 0 %}
        <li>
            <a href="{{ p.url }}" class="{{ active_page }}">
              {% if p.header.icon %}
                <i class="fa fa-{{ p.header.icon }}"></i>
              {% endif %}
              {{ p.menu }}
            </a>

But this is the resultIMG_20180828_092801|281x500

8 years ago

Ok, i have solved...i've changed the line 11 in the quark open publishing with your solution et voilà... thank you so much...like always...

8 years ago

Great! And I'll update my step 3 to make things at bit more clear...

8 years ago

You may encounter an issue when hovering over a submenu. The submenu seems to disappears when hovering to the second submenu item.

In the above mentioned issue user 'rpowers' suggest that adding the following to your css file will solve the issue:

CSS
nav:hover { 
   z-index: 100; 
}

In my experience the issue only happens in an inherited theme.

👍 1
8 years ago

Hi, i have another question about the submenu...always in quark theme...I attach a screenshot, I would not see the "+" sign to open the submenu, but directly click on the menu item to bring up the submenu ... how can I do? thank you in advance...IMG_20180830_122109|281x500

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 125 19 hours ago
General · by pamtbaau, 1 day ago
1 89 24 hours ago
General · by Andy Miller, 2 days ago
0 73 2 days ago
General · by Marcel, 12 months ago
6 382 5 days ago
General · by Duc , 6 days ago
3 69 6 days ago