Page 1 of 1

unable to create menu under child category

Posted: Thu Feb 13, 2014 10:45 am
by bharathrichard
working version is 3.0.5-GA in that i am unable to create menu under child category

Re: unable to create menu under child category

Posted: Thu Feb 13, 2014 4:22 pm
by phillipuniverse
This will require custom development. The heat clinic is designed as a demo application of an example implementation to show some of the features of Broadleaf. You can add sub-categories within the admin but you will have to customize the frontend display if you want to show them as a menu item like you referenced there.

Re: unable to create menu under child category

Posted: Fri Feb 14, 2014 2:25 am
by bharathrichard
i need menu under sub category

Re: unable to create menu under child category

Posted: Thu Apr 02, 2015 1:19 pm
by RajuNene
Hi,

I am trying to do the same but not able to achieve this.
Actually confused with the maxresults attribute of blc:categories; CategoriesProcessor says maxresults is optional but there is a check against maxresults.
if (subcategories.size() > maxResults) {
subcategories = subcategories.subList(0, maxResults);


If anyone in this forum solved the drop down menus in earlier, can you please provide the steps to achieve the dropdown menus to a degree/depth of 4.

Appreciate your help in resolution.

Thanks,
Raj

Re: unable to create menu under child category

Posted: Thu Jul 16, 2015 10:57 pm
by sumit784
Use this code in you "Nav.html"

----------------------------------------------------------------

<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="8" />

<ul> <!-- Default Navigation Bar-Main Menu -->
<li th:each="category : ${navCategories}" th:unless="${#strings.isEmpty(category.url)}">
<a class="home" th:href="@{${category.url}}" th:class="${categoryStat.first}? 'home'" th:text="${category.name}"></a>

<!-- First level -->
<ul th:if="${#objects.nullSafe(category,default)}" class="first-level-menu">
<li th:each="cat : ${category.getChildCategories()}">
<a th:text="${cat.name}" th:href="@{${cat.url}}"></a>

<!-- Second level -->
<ul th:if="${#objects.nullSafe(cat,default)}" class="second-level-menu">
<li th:each="cat1 : ${cat.getChildCategories()}">
<a th:text="${cat1.name}" th:href="@{${cat1.url}}"></a>

<!-- Third level -->
<ul th:if="${#objects.nullSafe(cat1,default)}" class="third-level-menu">
<li th:each="cat2 : ${cat1.getChildCategories()}">
<a th:text="${cat2.name}" th:href="@{${cat2.url}}"></a>

<!-- Fourth level -->
<ul th:if="${#objects.nullSafe(cat2,default)}" class="third-level-menu">
<li th:each="cat3 : ${cat2.getChildCategories()}">
<a th:text="${cat3.name}" th:href="@{${cat3.url}}"></a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>


</nav>

-------------------------------------------------------------