Bootstrap 3 Menu on Kentico 8

Brendon McCarthy asked on June 6, 2014 17:29

I've seen a question (or two) in the "closed" forums about Kentico menus and Bootstrap 3 menus here. Now that Kentico 8 is actually built on Bootstrap 3, is there a newer/better way to go about this? The CMSListMenu while very configurable seems to be lacking still how it assigns classes to parent/sub menus.

<ul class="nav navbar-nav">
  <li><a href="#">Other link</a></li>
  <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Parent cat</a>
    <ul class="dropdown-menu">
      <li><a href="#">Sub 1</a></li>
      <li><a href="#">Sub 2</a></li>
    </ul>
  </li>
</ul>

Same menu from previous post for reference, same format applies. The best I can get the CMSListMenu to generate is this:

<ul class="nav navbar-nav CMSListMenuUL">
  <li class="nav navbar-nav CMSListMenuHighlightedLI">
    <a class="nav navbar-nav CMSListMenuLinkHighlighted" href="#">Other link</a>
  </li>
  <li class="dropdown">
    <a class="nav navbar-nav CMSListMenuLinkHighlighted" href="#">Parent cat</a>
    <ul class="dropdown-menu CMSListMenuUL">
      <li class="dropdown-menu CMSListMenuLI">
        <a class="dropdown-menu CMSListMenuLI" href="#">Sub 1</a>
      </li>
      <li class="dropdown-menu CMSListMenuLI">
        <a class="dropdown-menu CMSListMenuLI" href="#">Sub 2</a>
      </li>
    </ul>
  </li>
</ul>

Suggestions?

Correct Answer

Brenden Kehren answered on June 8, 2014 09:20

The CSS List Menu is a simple menu and doesn't offer any complex styling abilities like you are looking for. You'd have to add all your own CSS classes to accommodate what Kentico is already providing. You should look into using the Hierarchical Viewer. Here's an article although from v7 but hasn't changed much if at all.

2 votesVote for this answer Unmark Correct answer

Recent Answers


Jakub Oczko answered on June 9, 2014 12:04

I agree with Brenden that the Hierarchical Viewer is the best choice. I would like to point to the sub-level support in Kentico 8. You can define entry point for nested transformations. You can find more information in the articles about Hierarchical transformations and UniView.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.