[Feature Request] Relationship CRUDs inside Show Operation (or as a Widget) #262
Replies: 23 comments 5 replies
-
Hello @xDasty Hope to find you well. Indeed this (or similar) is one of the most requested CRUD features along with the multiply/matrix field. Atm we are providing this functionality with a package developed by one of our users backpack instant fields It's not exactly what you describe with the related index view, but you could see by example how they are doing it and apply to your scenario ? If you come up with something you think might be integrated in CRUD, please be our guest and submit a PR. Atleast i can promisse you we will discuss it and later on the road see if it fits. Best, |
Beta Was this translation helpful? Give feedback.
-
Hi @pxpm I attach an image to show the result this shows only a relationship, (modulos-> elements), In this example |
Beta Was this translation helpful? Give feedback.
-
@xDasty hello, i like how it looks. Nice job. Mb u can make it like separate package. |
Beta Was this translation helpful? Give feedback.
-
Hi @lotarbo |
Beta Was this translation helpful? Give feedback.
-
Hi the @xDasty I also like it, especially the concept :) If you add an element on that page it automatically gets attached to the Modulos or you choose which Modulo to attach when creating ? Maybe you can work with some session data there to pre-populate Modulos select if not doing that. How about other types of relations ? Poly etc ? Best, |
Beta Was this translation helpful? Give feedback.
-
Hi @pxpm when I add or modify an element, I can: |
Beta Was this translation helpful? Give feedback.
-
hi guys i'm going crazy I update you, for version 3.6 I had implemented the solution on the model controller public function show($id)
{
....
$this->crud->sub_entry = new ElementCrudController();
$this->crud->sub_entry_name_route= $this->crud->entity_name;
$entry_ = $this->data['entry'];
$this->crud->sub_entry_relation_id= $entry_->getAttributes()['id'];
+ other variables
....
} on the element controller public function getCrud($crud_name_route_, $crud_relation_id_)
{
$this->setup();
$this->crud->addClause('where', $crud_name_route_.'s_id', $crud_relation_id_);
return $this->crud;
} in show.blade.php @if(isset($crud->sub_entry))
$getCrud = $crud->sub_entry->getCrud($crud->sub_entry_name_route, $crud->sub_entry_relation_id);
$entries = $getCrud->getEntries();
@include('admin/show_sub_content', ['crud' => $getCrud , 'entries' => $entries, ... other variables...) applying the same principle to version 4 returns me
|
Beta Was this translation helpful? Give feedback.
-
Hi guys, I think this is a really neat concept @xDasty - great work. I think a great first step towards making the admin panels more interactive would be to have links to the related entries in the Show operation, that's why in the main repository I'd rather take care of that issue first. Since that's a little easier to do, I think. But I'm sure many people would love it just like you've done it - as additional CRUDs inside the Show operation. This is a great second step! Perhaps this can be built as a Backpack Widget? That way the entire logic could live in one However you decide to do this - I don't expect it to be easy to build. I see you've already posted a screenshot of it, so kudos to you! Congrats! (1) Do the line buttons work? Cheers! |
Beta Was this translation helpful? Give feedback.
-
Any progress on this for v4? |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I had to fix version 3.6, by the end of the month I continue porting to version 4. |
Beta Was this translation helpful? Give feedback.
-
How's it going? |
Beta Was this translation helpful? Give feedback.
-
Waiting for this feature .. |
Beta Was this translation helpful? Give feedback.
-
Hi Guys I have entered a fairly complete example of how it works I will provide a guide to be able to integrate it. |
Beta Was this translation helpful? Give feedback.
-
Hi! Any news on this? Just started working with backpack a month ago and, just like a lot of us, I reeeeally need this feature. Thanks! |
Beta Was this translation helpful? Give feedback.
-
For version 3 you can use the code I wrote, looking at the code it is very easy to add |
Beta Was this translation helpful? Give feedback.
-
thanks for the reply! I was talking indeed about the v4, since that's what I'm using |
Beta Was this translation helpful? Give feedback.
-
@enefeka we're not actively working on this right now. We're currently knee-deep in bug fixing in order to get version 4.1 out the door, which was a HUGE endeavour. Only afterwards will we be able to prioritize and maybe put together a solution as a non-breaking update. If you want this sooner, it shouldn't be terribly difficult to create in 4.0 using Widgets. Or bug @izica to get his code - I believe that solution is a Backpack column. If you end up with something general, please consider sharing your code so others can benefit too. Sorry I can't be of more help right now! |
Beta Was this translation helpful? Give feedback.
-
Actually maybe I can. In Backpack 4.1 there are a few alternatives to this:
If that works for you, you can upgrade to 4.1 right now, it's super-stable. The only bugs left to squash are related to the |
Beta Was this translation helpful? Give feedback.
-
Hi @tabacitu. I might just do both of those things, already asked @izica for the code and I'm now looking at 4.1 and what you said, it also might work for me. Thanks and keep up that amazing work! |
Beta Was this translation helpful? Give feedback.
-
Hi Guys I hope before August to make my work compatible with the latest version, |
Beta Was this translation helpful? Give feedback.
-
I think this widget is what you are looking for no? https://github.com/izica/relations-widgets-for-backpack |
Beta Was this translation helpful? Give feedback.
-
Personally I think it would be great if the relations can be organised into tab groups as some model have lots of relations [Relation A, B, C] [Relation D, E, F] [Relation G, H, I] |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, Thanks for sharing this! The good news is that during the development of Backpack v7, we plan to work on this feature to enable displaying related model lists on Show pages with inline actions. While we can’t provide an exact timeline yet—there’s a lot of work lined up—it is indeed on our backlog. We share your enthusiasm for making this kind of functionality more accessible to everyone. Thank you again for bringing it up and for your past contributions to Backpack! If you have any tips or insights from your v3.5 implementation, feel free to share; we’d love to learn more. Cheers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Guys
I put my question to you, I have already realized this functionality with version 3.5, and I would like to apply it to version 4, and make it available to everyone.
the goal is to create a Show page that displays in addition to the fields of the X model, the lists of the associated Y and Z models.
example:
category books, I access the show page that shows me the name of the category "comedy", under add the list of all the comedy books. The list will be the same as the view of the index () with all the actions (preview, edit, delete, [by clicking on edit it will be possible to edit the book through a modal window])).
I hope I explained the question well, because I think it's a very useful feature.
for any clarification just ask.
Beta Was this translation helpful? Give feedback.
All reactions