chris-ware / nova-breadcrumbs

Breadcrumbs for Laravel Nova
152 stars 44 forks source link

Use nova-breadcrumbs and customize headers? #108

Closed bernhardh closed 4 years ago

bernhardh commented 4 years ago

Its actually not a real bug, but more a question: Is it possible, to use your breadcrumb package AND make own changes to the custom header files?

chris-ware commented 4 years ago

@bernhardh I believe so. I've created Pre and Post components that can be overwritten in basically the same way as I overwrite the base header components themselves.

bernhardh commented 4 years ago

Oh, I was already wondering, why you created so many (empty) components. Now I understand. Its too late, my brain is working too slow.. I will give it a try tomorrow.

bernhardh commented 4 years ago

Ok, I tried it out and it worked as expected! Great job!

But that works only for your package. If I would use another (additional) package it wouldn't work. And it's not the ideal solution to add dozens of empty "pre" and "post" components, just in case someone would need it. I know, there is no other solution right now, but I have made a suggestion with a proof of concept to nova.

Maybe you can have a look on it and say what you think about. https://github.com/laravel/nova-issues/issues/2920

chris-ware commented 4 years ago

Cool, thanks. I did have an idea for a package that basically did exactly as you've said on the issue on Nova Ideas. It was going to be a requirement for Breadcrumbs to work and then you could just add your own components to the header or toolbar components.

The only main downside is the fact that each of the different views have differences between the props they have available.

bernhardh commented 4 years ago

Yeah, that was plan B, to create a package as you mentioned, if the nova team says no to my suggestion (what I am expecting, to be true). The main point, why I think its better to solve this issue in nova directly is, that with a package solution, all other packages will need to use this new package as a requirement, which isn't really realistic. And the other point is, that you can only extend the Header section, my suggestion is to add also a bottom/footer section on ALL views.

The downside is similar to the current situation. You have different props/data available in the different CustomXXXHeader components - not a real difference.

bernhardh commented 4 years ago

Maybe you can add a comment on my issue, to show, thats not just me, seeing this problem?

bernhardh commented 4 years ago

Since I don't think that this will every been solved by nova itself, I created a package. Would be very gratefull if you can have a look on it or even use it:

https://github.com/bernhardh/nova-dynamic-views

Feedback and critics is always welcome ;)