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.

Support

[Antimatter] Bug in connection with Vimeo/Soundcloud?

Solved by pamtbaau View solution

Started by werdi 8 years ago · 4 replies · 485 views
8 years ago

I'm having an issue with a modified Antimatter theme.

I created a "submenu" in the header of a page and suddenly, it seems as if the links are not clickable anymore: http://test.learahelbader.com/de/media

While the same submenu is clickable on this other page, which is a complete copy:
http://test.learahelbader.com/de/vita

I don't know what I'm missing. The only connection is that on the "media" (the first) page there are embeds to Soundcloud/Vimeo.

Can anyone take a quick look? Cheers!

8 years ago

@werdi I don't think it has anything to do with Soundcloud/Vimeo.

When you hover a little bit above 'Video', you'll see the mouse pointer change. If you click there, you will jump to the #video anchor.

The difference between both pages is the empty div <div id="header"></div> versus <div id="vita"></div>. They are defined just above the submenu. The div with id 'header' has css attached, while div with id 'vita' has not.

The attached css is intented for the real <header> which also uses the id 'header'. By the way, Ids should never be reused.

If you rename 'header' the issue will be fixed.

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

Thanks so much for taking a look... only... where can I rename "header"?

8 years ago Solution

@werdi I was a bit incomplete in the previous reply. Sorry for that...

TL;DR: Change the value of 'menu: Header' in the frontmatter of the file containing the submenu.

Why?

The page is a modular page, using template /templates/modular.html.twig which loops through all modules and prints the module's content.

TWIG
{% block content %}
    {{ page.content }}
    {% for module in page.collection() %}
        <div id="{{ _self.pageLinkName(module.menu) }}"></div>
        {{ module.content }}
    {% endfor %}
{% endblock %}

Pay attention to the line:

HTML
<div id="{{ _self.pageLinkName(module.menu) }}"></div>

which creates an empty div with the value of 'module.menu' as id....
If that module has a frontmatter with 'menu: header', an empty div with id="header" will be generated.

Since the designer has defined css for <header id="header">, the new div with the same ID will also use that same css and hence the layout of the page gets 'confused'...

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

Thanks so much, makes perfect sense. Thanks for taking the time to explain.

It worked!

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 16 hours ago
Support · by Anna, 3 days ago
2 66 19 hours ago
Support · by Justin Young, 20 hours ago
1 34 20 hours ago
Support · by Duc , 1 week ago
2 70 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago