Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin subnav menus to allow optional badge counts #4756

Closed
matt-adigital opened this issue Aug 14, 2019 · 1 comment
Closed

Plugin subnav menus to allow optional badge counts #4756

matt-adigital opened this issue Aug 14, 2019 · 1 comment
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev

Comments

@matt-adigital
Copy link

Feature Request!

Can we please have badge counts on subnav items? Noticed that we can have them on the main plugin item, and in sidebars, but not on subnavs. This could be an optional array key which is ignored if left blank.

<a href="{{ url(item.url) }}"{% if itemIsSelected %} class="sel"{% endif %}>{{ item.label }}</a>

Updating the above code wrap the text in a span with class of label and then checking for item.badgeCount in a condition to add a span with class of badge would enable this. Then in our plugin where we set our subnav label and url we can easily just define a badgeCount also.

This would be a handy option to have where we are using subsections within plugins along with sidebars like so:

Screenshot 2019-08-14 at 16 18 20

The sidebar counters are already possible but the subnav ones aren't. Not sure if theres an explicit reason for this but could it please be added? Thank you.

@brandonkelly brandonkelly added extensibility 🔌 features related to plugin/module dev enhancement improvements to existing features labels Aug 15, 2019
@brandonkelly brandonkelly added this to the 3.3 milestone Aug 15, 2019
@brandonkelly
Copy link
Member

This has been implemented for Craft 3.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features extensibility 🔌 features related to plugin/module dev
Projects
None yet
Development

No branches or pull requests

2 participants