I love sticky top menus...
So that was the first thing I tackled when I started this site.
The HTML in the "header" position looks like this:
<header class="header container-header full-width <?php echo $stickyHeader; ?>">
<div class="grid-child">
<div class="navbar-brand">
<a class="brand-logo" href="/<?php echo $this->baseurl; ?>/">
<?php echo $logo; ?>
</a>
<?php if ($this->params->get('siteDescription')) : ?>
<div class="site-description"><?php echo htmlspecialchars($this->params->get('siteDescription')); ?></div>
<?php endif; ?>
</div>
</div>
<?php if ($this->countModules('menu', true) || $this->countModules('search', true)) : ?>
<div class="grid-child container-nav">
<?php if ($this->countModules('menu', true)) : ?>
<nav class="navbar navbar-expand-md">
<?php HTMLHelper::_('bootstrap.collapse', '.navbar-toggler'); ?>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="<?php echo Text::_('TPL_CASSIOPEIA_TOGGLE'); ?>">
<span class="icon-menu" aria-hidden="true"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<jdoc:include type="modules" name="menu" style="none" />
</div>
</nav>
<?php endif; ?>
<?php if ($this->countModules('search', true)) : ?>
<div class="container-search">
<jdoc:include type="modules" name="search" style="none" />
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</header>
So the <header> div contains three main divs:
- child-grid, with two divs: brand-logo and site description,
- container-nav, with the divs necessary for a nice collapsible menu,
- and container-search.
For now, I've just put the first child-grid to display:none; (and tweaked margins, padding, and display), which is fine for now, but I will have to insert my logo, which should also be sticky and overlap the image in the banner position. Well, that was pretty simple! Added a fixed height to .navbar-brand!