Formfeed-UK / nova-breadcrumbs

Augments Nova 4 Breadcrumbs with nesting and resource/static override methods
MIT License
19 stars 8 forks source link

Remove relationship from breadcrumb #8

Open RenoLooijmans opened 2 years ago

RenoLooijmans commented 2 years ago

First of all - thanks for this great package!

Is it possible to somehow remove the relationship in the breadcrumb? I've tried it with modifying the config as well as addin the method parent returning null, but this does not seem to work as expected.

public function parent() {
     return null;
}

To clarify, I'd like to remove the belongsTo relationship in the breadcrumb:

image

Secondly, it seems that lenses are not supported?

ianrobertsFF commented 2 years ago

Lenses aren't currently supported, I have some to implement in the next couple of weeks, so I'll be taking a look at lens support then. If you need it sooner you're welcome to submit a PR.

Is it a specific parent resource you're looking to exclude? IE:

Home -> Crumb 1 -> Crumb1:A -> ~Crumb 2 -> Crumb2:A ->~ Crumb 3

Or are you looking to exclude all parents for a resource? IE:

Home -> ~Crumb 1 -> Crumb1:A -> Crumb 2 -> Crumb2:A ->~ Crumb 3

RenoLooijmans commented 2 years ago

Thanks for your quick reply! I'm just getting into Nova so I'm afraid I'm of no help at this moment..

For this specific resource I'm looking to exclude all parents. But I guess either will suffice.

ianrobertsFF commented 2 years ago

No problem, ill leave this open and close it when I've done the changes to allow for lenses.

Just testing an additional static attribute on your resource called resolveParentBreadcrumbs that when set to false will disable all parent breadcrumbs from that resource.

It satisfies the second option in the examples I gave above and would be used on the Crumb 3 resource to disable all parent resource breadcrumbs.

ianrobertsFF commented 2 years ago

Okay the change for resolveParentBreadcrumbs is in release 1.0.3.

Ill reply here when the Lens support is added.

ianrobertsFF commented 2 years ago

I've been looking into Lens support, and whilst its trivial to add the breadcrumbs to the Lens view itself, there is no feedback given when you navigate from a Lens to a resource detail that you have come from the Lens, rather than the Index page for the resource.

As such its not possible to automatically send the user back to the index or lens depending which they originally came from.

I'll try and see if theres anything on the inertia side I can intercept to pass off to the breadcrumbs card. I did some work on this for nova-tabs, just gotta remember how it works and see if its possible.

RenoLooijmans commented 2 years ago

I've been looking into Lens support, and whilst its trivial to add the breadcrumbs to the Lens view itself, there is no feedback given when you navigate from a Lens to a resource detail that you have come from the Lens, rather than the Index page for the resource.

As such its not possible to automatically send the user back to the index or lens depending which they originally came from.

I'll try and see if theres anything on the inertia side I can intercept to pass off to the breadcrumbs card. I did some work on this for nova-tabs, just gotta remember how it works and see if its possible.

Got it. Sounds rather complex. More than I would've guessed at least.

Thanks for you effort though!

AbdallahAli912 commented 1 year ago

just use public static $resolveParentBreadcrumbs = false;

will disable parents breedcrumps