Skip to content

Tutorial/Dropdown for Symfony 4.2, bootstrap(s), etc, navbar, dropdown, etc. #397

Open
@tacman

Description

@tacman

I'm having a really hard time creating a simple bootstrap navbar with a dropdown.

There are LOTS of webpages that describe how to do it, but I haven't had any luck with any solution, except to use MopaBootstrapBundle, which seems like overkill for just a navbar.

In the same way that Symfony forms has a few built-in options (bootstrap_3_horizontal, etc.), I basically want to simply set the twig theme and then configure the top navbar, side navbar, etc.

Part of the confusion is how many options there are. Many of them examples on the web add the class and attributes in the menu creation, but that seems like a very bad practice, to lock in that a menu item is of the navbar-item class. That'd make more sense when rendering the menu (from the twig template).

Regardless, despite hours of hacking I'm unable to get a simple bootstrap navbar or sidebar menu working. Can anyone point me to a working example of a navbar with dropdown that includes a MenuBuilder class, the html/twig that renders it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions