Open UnbekanntesPferd opened 1 year ago
Hello there! Thanks for opening your first issue on this repo!
Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.
Backpack communication channels:
backpack-for-laravel
tag;Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.
Thank you!
-- Justin Case The Backpack Robot
Hello @UnbekanntesPferd
Thanks for the suggestion.
Isn't that (or something similar) what we are already doing with repeatable by creating relationships
using the repeatable subfields ?
Please have a look at https://backpackforlaravel.com/docs/5.x/crud-fields#save-additional-data-to-pivot-table and also https://backpackforlaravel.com/docs/5.x/crud-fields#create-related-entries-in-a-modal-using-the-inlinecreate-operati
Let me know if that is what your are looking for.
Cheers
Hi @pxpm ,
thanks for your reply. It's not exactly what my suggestion was.
I was thinking about a relationship for multiple different models. So instead of having one "+New Item"-button, it would need a dropdown and an add-button, to not "only" be able to add people (like in the example), but also to e.g. animals, trees, ... that are completely different models with different field types. Or maybe I'm not fully understanding the example and it already offers that?
@UnbekanntesPferd Maybe it's easier to understand with a concrete example, some use case where that would be helpfull.
Imagine that I have a City
model, that has Persons, Trees and BelongsTo a country (country_id).
In the City create, I would be using the relationship (hasMany/BelongsToMany) Persons/trees with subfields, and in the BelongsTo country, I would use inline create (show the + New Item).
That will allow you to create Persons (BelongsToMany also supports InlineCreate), Trees and Persons.
Maybe check your demo repository https://demo.backpackforlaravel.com and our demo code: https://github.com/Laravel-Backpack/demo
@pxpm Sorry, seems like I'm failing in explaining it :-).
Here is an example of how it could look like. Maybe this makes it easier to understand:
Ohh, I think I got the idea now ... thanks for the screenshot it really helped. 👍
We don't have nothing like that in core. You can do it with 3 separate fields, 1 for each entity but that's it, all together it's not possible at the moment.
Remember that this "fields" are just html entities, you can start a copy of a custom repeatable php artisan backpack:field custom_repeatable --from=repeatable
and customize it to have the interface you desire, but almost 100% it would also need to override the saving process as Backpack is not aware that the same field could submit 3 different entities.
I will be moving this to the ideas repository, it's from there that we, from time to time, see what requests have traction (people show desire to have it), and we build the new features based on what users ask.
Sorry if I can't help much more. Wish you the best 🎅
Thank you very much! I will play a bit with the (custom) repeatables, maybe I'll find some solution :)
All the best to you!
Note - we did create a package a few years ago, to help create pages easily using "blocks". Each block can then hold different types of fields:
It's no longer working on the current version of Backpack, it was Bootstrap 3 and the JS library we used is no longer maintained. But... yeah... the idea... is this what you meant @UnbekanntesPferd ?
@tabacitu Yes, this looks exactly like what I was looking for! Maybe you can add it to your (probably very long) list of feature requests ;-)
Feature Request
What's the feature you think Backpack should have?
For content creation a nice feature I saw in Drupal's paragraphs module, was to have something similar to Backpack's repeatable but for different model types. So you can e.g. create the content of a news article by adding text, image gallery, text again, linked articles, text again, ... where each of these types can be sorted/deleted/... I couldn't find a way to implement this already with current backpack fields.
Have you already implemented a prototype solution, for your own project?
Drupal paragraphs: https://www.youtube.com/watch?v=Fy9s01T30uo
Do you see this as a core feature or an add-on?
Not sure.