Open aerni opened 4 years ago
There's a pretty good chance we'll be implementing pinned nav items. See the discussion in https://github.com/statamic/ideas/issues/74
That's not quite the same, is it? Pinned is great to use for certain collections for sure. But in this case, I'd like to create a whole new Section for an addon and add a collection there. Plus other custom menu items.
Yeah, your mileage is going to vary, as Nav::extend()
isn't smart enough to deal with listing pages (and I'm not sure it should).
If you need to remove a collection from the Collections
nav and listing, you might be able to extend CollectionRepository
and bind your implementation to the container (see https://statamic.dev/extending/repositories). Could get messy though, especially within an addon where your end user (or another addon) might be intentionally binding their own CollectionRepository
extension.
If there's a valid enough use case, it might be better to have some kind of hide: true
or listable: false
setting to a collection's yaml file, to hide the collection from nav and listings automatically. Would have to think through implications across the control panel though (ie. permissions, etc).
Yeah, something like listable: false
could make sense.
Hey, did you ever find a way to solve this? Wanting to remove a collection myself from the nav/collection overview page but failing.
No, there's currently no solution for this.
I'm working on an addon that has a Collection of Products. I would like to move this Products Collection to its own dedicated Nav and remove it from the regular Collections Nav and Collections Listing.
I was able to remove it from the Collections Nav already. But couldn't find a way to remove it from the Collections Listing as well.