verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

hasChildrenClass not adding class on render function #340

Closed samroberts707 closed 1 year ago

samroberts707 commented 1 year ago

Describe the bug

I'm using the craft.navigation.render function to load my nav. I've declared the hasChildrenClass as per the docs but the parent LI doesn't have the defined class.

Here is what my render function looks like:

{{ craft.navigation.render('mainNav', {
     ulClass: 'nav-items',
     liClass: 'nav-item',
     aClass: 'nav-link',
     activeClass: 'nav-active',
     hasChildrenClass: 'nav-has-children',
}) }}

Here is a screenshot of what is rendered from browser inspection. (I've manually removed the HREF value)

Screenshot 2023-01-17 at 13 28 53

Steps to reproduce

  1. Create Navigation with Children
  2. Render navigation in template using the .render function

Craft CMS version

3.5.16

Plugin version

1.4.21

Multi-site?

No

Additional context

No response

engram-design commented 1 year ago

hasChildrenClass is only available in Navigation 2 for Craft 4.