Question about pinning section to mobile nav view #2146
-
I really appreciate everything that's been done on this project. I've been working on a particular customization for a few days and would appreciate if anyone has any advice! I'm hopeful there is an already available class or style option that I can include. Here's a description of what I've done so far and where I'm looking for advice: I'm working to add extra navigation in the mobile view, such as the 'Home' section in the screenshot below: I did this by using the md-nav__source class and used an override nav.html file. See code below: ...
<nav class="{{ class }}" aria-label="{{ lang.t('nav.title') }}" data-md-level="0">
<label class="md-nav__title" for="__drawer">
...
</label>
<div class="md-nav__source">
<a href="{{ site_url }}" title="Home" class="md-source">
<div class="md-source__icon md-icon">
{% include ".icons/material/home" ~ ".svg" %}
</div>
<div class="md-source__repository">
Home
</div>
</a>
</div>
</nav> However, this extra section disappears when you click through within the mobile nav view. I'd like to keep this present while using the nav. As you see below, the section is no longer there: Like I said earlier, I'm hoping there's a class that's available or a style that I can apply to leave that section there even when navigating to sub sections. Much appreciate any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The |
Beta Was this translation helpful? Give feedback.
The
.md-nav__source
classes are generally only intended for the source (repository information), so it's semantically not the correct class..md-nav__item
in combination with.md-nav__link
would be more correct, as used in the navigation itself. Putting your changes in the nav containers might not be the best idea, as they will stretch to the entire height of the top-most nav container. Maybe try putting your stuff in.md-sidebar__scrollwrap
?