backdrop-contrib / reference

Defines a field to allow Backdrop entities to reference each other.
GNU General Public License v2.0
4 stars 6 forks source link

Reference more than one entity type. #6

Closed klonos closed 7 years ago

klonos commented 8 years ago

This has been discussed over the core queue and during dev meetings. Not sure if we are still pursuing this, but wanted to mention Dynamic Entity Reference that says does this:

dynamic_entity_reference

Create a single field to hold references to Users and Nodes. Or Terms and Nodes, or all three.

...of course our goal is to have a single, autocomplete field doing that, whereas that module seems to only be able to have a combined field of a drop-down allowing you to select entity type + an autocomplete that only looks up whatever entity type has been selected from the respective drop-down.

klonos commented 8 years ago

...I just gave that module a quick spin over at simplytest.me and indeed compared to our initial goal (a single autocomplete field that would allow referencing any entity type), this seems like a "compromise": you still allow site builders to place a single field on the node create/edit form but the end user using the form needs to select a specific entity type to reference (through the drop-down). Not sure if we want to implement the same compromise thing in core.

mikemccaffrey commented 7 years ago

Hey @klonos, this is the route that I started down when I went to create the Reference module. However, I ended up coming around to the argument from @jenlampton that this functionality would only be used by a small subset of sites, and a single-entity-type target is much more common.

The other thing that convinced me is that as soon as I stopped trying to support multiple entity types, I was able to drastically cut the amount of code in the module.

Closing this issue, since if someone wants to implement this functionality, we are likely going to suggest that they do it in a contrib module.