Hi,

What would be the best approach on implementing custom Entity Reference as property instead of as a field?

Thanks,
Mihai

Comments

fmizzell’s picture

Waiting for 3.x :) . We are working hard to push an alpha out, and that will come with an entity reference behavior that will work with properties

fmizzell’s picture

Version: 7.x-2.0-rc2 » 7.x-3.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Eugene Fidelin’s picture

Ability to have entity reference behaviour for properties could be very useful feature.

When can it be released?

fmizzell’s picture

@Eugene Fidelin. The current goal is to get an alpha before BADCamp

mihai_brb’s picture

Meanwhile I am using entityreference_autocomplete in my default_widget. You have almost the same settings as in entity reference field, but in code.
https://drupal.org/project/entityreference_autocomplete

When you need it for multiple properties you could write a generic property behavior with some naming convention for the property like id_{entity}. If anyone is interested I will be happy to elaborate.

Best,
Mihai

elpino’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Issue summary: View changes

I'm interested!!

I've been searching all over and I can't find a good source on how to create a property behaviour that let's me reference entities using the entityreference_autocomplete module.

Mind you I am NOT looking to add a field, what I want is a property.

If you could please elaborate that would be great @mihai_brb !

mihai_brb’s picture

Hi elpino,
Check out this module that has a few field replica behaviors. There is one for referencing entities.
https://www.drupal.org/project/eckextend
You can check the code to see how to implement a custom behavior. But if you only need to add a reference property the module should be sufficient.

Best,
Mihai