3rd level catgory menu
7 posts by 3 authors in: Forums > CMS Builder
Last Post: March 14, 2017 (RSS)
Hi Guys,
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?
Tim (toledoh.com.au)
By Dave - September 16, 2016
Hey Tim,
>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
[_isAncestorSelected] =>
[_isDescendantSelected] =>
[_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.
Thanks!
interactivetools.com
Thanks Dave,
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.
Tim (toledoh.com.au)
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!
Tim (toledoh.com.au)
By Dave - March 14, 2017
Hi Jeff,
> 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.
interactivetools.com