GRAV One-Page Antimatter Theme

I like the modular layout for the home page of the Antimatter One-Page theme but I would like to add menu links to other pages…do I edit modular.html.twig to accomplish this?

In the file that is the parent of the modular pages (probably user/pages/01.home/ you can add/edit the header variable:

onpage_menu: false

This will turn off the onpage ‘modular’ menu and instead use the regular page structure to build the pages.

However, if you want to mix both the onpage modular page menu AND the regular page structure-based menu, the simplest thing is to leave the on-page menu (as that dynamically adds the named links), and then simply add your other menu items manually via the site.yaml:

    - text: Source
      icon: github
    - icon: twitter

I just realized this menu stuff is not documented. I have made a note to add this to the documentation.

Thanks for the help. I went with the onpage_menu: false solution which got the navigation the same on all pages. I tried adding the menu items from your post to my site.yaml but they do show up on any of the pages?

Here is my user\config\site.yaml:

name: “Page Technology Marketing, Inc.”

description: "PCLWorks is the perfect solution for viewing, converting, and debugging PCL print streams. Quickly and easily convert PCL to PDF and other output formats."
title: PageTech


Please use a code block for your site.yaml paste ( see help icon in top right of forum post box)

Spacing is critical for yaml.

Also check to make sure antimatter theme is up to date. bin/gpm update

Ran the update command and there they were!



Has this changed since April, because menu items added in site.yaml won’t show when onpage_menu: true?

Antimatter’s modular.html.twig does not include the Add this snippet

        {% for mitem in %}
                <a href="{{ mitem.url }}">
                    {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
                    {{ mitem.text }}
        {% endfor %}

in that file, to add it.

@rhukster should we add it by default?

Yah that logic was never in the ‘onpage menu’, but probably should be.

@flaviocopes Thanks that worked.

I have a problem. When onpage_menu: true and I add a page on site.yaml, the link is shown on the menu, but nothing happens when it’s clicked (the link is pointed correctly, but it simply doesn’t work). I have everything up to date. Any ideas?

1 Like

What is the HTML generated for that link?

This is the HTML:

  • Blog
  • Then the link is fine. Could be the CSS causing problems with the z-index of the elements?

    I have the same problem. The new menu items are there, but clicking on them does not work.
    Even if I set the url directly through e.g. Firebug , it does not work. Also tried playing with z-index. No results.

    Hmm…after a couple of refreshes…it works now. #strange

    Did you disable the cache?

    I guess that was my problem

    How can I change the order of the menu items, so that the modular page menu items display first and then the rest of the pages?