sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
135 stars 54 forks source link

Access navigation items #45

Closed thomascenni closed 5 years ago

thomascenni commented 5 years ago

Hi, is there a way to access {$navigation.main} items inside a template ? I mean, I need to access the navigation item "name" and its "link" to be able to render the navbar using Bootstrap 4. This version of Bootstrap requires a class "nav-item" and a class "nav-link" to render correctly. See http://getbootstrap.com/docs/4.1/components/navbar/#nav for details. Today the {$navigation.main} is rendering all the HTML code without having possibility to modify it. Thanks

michu2k commented 5 years ago

Hi Of course you can easy change the default navigation. From the official docs :

In the theme folder you can also create your own module views. To do this, you need to create a directory modules/module_name and *.html files with names corresponding to the names of the original views. For example, the view of the contact form should be contained in the following path: themes/theme_name/modules/contact/form.html. Batflat automatically detects a new view and uses it instead of the module default view.

Create modules/navigation/nav.html and write code inside the file :)

thomascenni commented 5 years ago

Thanks! Worked like a charm.