3rd level catgory menu
7 posts by 3 authors in: Forums > CMS Builder
Last Post: March 14, 2017 (RSS)
I'm using the code from http://www.interactivetools.com/forum/forum-posts.php?postNum=2237572#post2237572 to create a standard bootstrap menu. However, this only works with parent and child (2 level) navigation. How could I enhance it to wrap a third level?
I can use
<?php if ($categoryRecord['_hasChild'] && $categoryRecord['depth'] == '1'):?><div class="thirdLevel"><?php endif; ?>
but how can I find the last 3rd level record of that specific 2nd level record so I can close the div?
By Dave - September 16, 2016
>how can I find the last 3rd level record of that specific 2nd level record
I can't really visualize it, but as a first step, can you try showme($categoryRecords) and see what's available?
[_isSelected] => 1
[_isSelectedBranch] => 1
[_isBreadcrumb] => 1
[_hasParent] => 0
[_hasChild] => 1
[_isFirstChild] => 1
[_isLastChild] => 0
[_hasSiblings] => 1
[_isSiblingSelected] => 0
[_isParentSelected] => 0
[_isChildSelected] => 0
I'm wondering if _isLastChild will do what you need?
Otherwise, if you can create a simple test case and email me that I could take a look.
I'm trying to implement http://geedmo.github.io/yamm3/ which extends the basic bootstrap menu to a "mega menu" format. It's not as simple as I thought to generate.
I'll work it a bit further then yell if (when) I need help.
By kitsguru - March 10, 2017
I am working on this same issue as I too use yamm3.
What would be useful would be to know how many children and siblings there are. Also is it possible to limit the number of levels that a user can enter. I don't want them to go more than 3 deep.
By Toledoh - March 10, 2017
I never progressed this Jeff, just seemed too hard at the time. Let me
know if you get it working!
By Dave - March 14, 2017
> is it possible to limit the number of levels that a user can enter.
Yes, you can limit that under: CMS Setup > Section Editors > Your Category Section > Advanced > Max Depth
And if you're trying to create a specific type of menu I recommend mocking it up in HTML first. If you can get it working right in plain HTML, but not in the viewer code, post the HTML, a backup of the section, and the section schema file, and we can take a look locally and help you with the code.
By kitsguru - March 14, 2017
Can't believe I missed that.