It is possible for users to choose their own header in Appearance. There are two headers built into Snowfire by default.
You can think of these two options as two different files. If you create a new header in Firecode you'll copy one of these and make your own.
When you have created a new header in Firecode that will be used by all templates. This is defined by settings.json.
If you remove these lines the system will use the default header. It is also possible to create another header if you want to try different header concepts.
The default headers are called echo-header-1 and echo-header-2. All default styles are namespaced and starts with .echo-header-X.
When creating new classes, don't use the name echo or sf. That will make sure it doesn't conflict with any official styles.
Add all styles for the header in your style.scss file.
Users might upload their own logo in Appearance. To show the logo you can use the logo function in header.tpl
This will output the logo with a link tag and img tag. It is retina optimized by default, and users are able to change size in Appearance.
Provide height/width if you want to define a custom size.
The navigation menu in Snowfire is built with com_menu.
{ com_menu (
id: '100',
description: 'Menu',
syncId: '100',
childrenLevels: '1',
activeClass: 'custom-menu-active',
hasChildrenClass: 'custom-menu-child',
itemHtml: '<li %class%><a href="%link%">%name%</a></li>',
childItemHtml: '<li %class%><a href="%link%">%name%</a></li>'
) }
The code above outputs the following HTML
<ul>
<li class="custom-menu-active custom-menu-active-root">
<a href="/">Home</span></a>
</li>
<li>
<a href="/about-us">About us</span></a>
</li>
</ul>
The class custom-menu-active is added to the current page. If you have a multi level menu the class custom-menu-active-root will only be added to the first menu level.
The default header (menu with dropdown) is using two different menus. One which is visible on desktops, and another one on smaller screens.
Using two different parts of the DOM to render each menu makes the CSS simpler for each menu. If you look at the code for these you'll see we use id="100" for the first menu and id="101" for the second menu. Since both menus is referencing the same menu we use the same syncId.