While we don't provide the subcategory navigation out of the box, this isn't too painful to add.
Check out the nav.html file, which currently looks like this:
Code: Select all
<nav>
<div th:remove="all">
<!--
This template displays the navigation of the site by looking up the category named "Nav"
and building a list of the categories sub-categories.
-->
</div>
<blc:categories resultVar="navCategories" parentCategory="Primary Nav" maxResults="6" />
<ul>
<li th:each="category : ${navCategories}">
<a class="home" th:href="@{${category.url}}" th:class="${categoryStat.first}? 'home'" th:text="${category.name}"></a>
</li>
</ul>
</nav>
An example of changing this for subcategories, would be to change that to something like this:
Code: Select all
<nav>
<div th:remove="all">
<!--
This template displays the navigation of the site by looking up the category named "Nav"
and building a list of the categories sub-categories.
-->
</div>
<blc:categories resultVar="navCategories" parentCategory="Primary Nav" maxResults="6" />
<ul>
<li th:each="category : ${navCategories}">
<a class="home" th:href="@{${category.url}}" th:class="${categoryStat.first}? 'home'" th:text="${category.name}"></a>
<ul th:if="!${#lists.isEmpty(category.getChildCategories())}" class="sub-menu">
<li th:each="cat : ${category.getChildCategories()}">
<a th:text="${cat.name}" th:href="@{${cat.url}}" />
</li>
<ul>
</li>
</ul>
</nav>
Then, you can add the following styles to your style.css:
Code: Select all
nav ul li:hover .sub-menu { display: block; }
nav ul li ul.sub-menu {
position: absolute;
top: 181px;
list-style-type: none;
background: url(../img/canvas.jpg);
z-index: 99999;
display: none;
width: 253px;
}
nav ul li ul.sub-menu li {
display: block;
float: none;
}
nav ul li ul.sub-menu li:hover {
background-color: #A9C8CB;
-webkit-transition: background-color 0.1s ease-in;
-moz-transition: background-color 0.1s ease-in;
-o-transition: background-color 0.1s ease-in;
transition: background-color 0.1s ease-in;
}
nav ul li ul.sub-menu img {
z-index: 99999;
float: left;
width: 200px;
height: 200px;
}
nav ul li ul.sub-menu a {
font: 12px/35px 'ProximaNovaBold', Helvetica, sans-serif;
color: #342020;
padding: 10px;
background: none;
}