@fago: Can entity module serve as a base for an entity reference module?

As explained in #626072: Entity reference:

In drupal 7, nodes and users will be handled by entity.inc as 'entities'. Other entities include comments and terms. Contrib modules can add new entities. Would it therefore not be best to replace Node Reference and User Reference with a multi purpose Entity Reference?
There might be a missing piece of the puzzle here in that entity.inc might not provide the information for how to format the output or link to the entity.
Nevertheless, if we could abstract referencing on an entity level we can simplify the implementation of cck references.
I am the maintainer of Block Reference and View Reference, and given how similar the coding is to Node Reference and User Reference I would like to see less redundancy and work caused by separate modules.
Has anyone looked into something like this?

Comments

yched’s picture

That's not the role of this module IMO.
+ I don't think we want noderef to depend on Entity API module.

fago’s picture

Yep, this module might cover "how to format the out or link" for entities based on it, but it's not an abstraction for core entities.

However outputting core entities is already rather similar for the different entities, thus we could rely on that. Also we could introduce further necessary entity-info properties, e.g. for how get the entities url - which the entity-ref could rely on without depending on the entity API.

I like the idea of having an "entity ref" field, but it would also require some more work, e.g. to make per-entity configuration options / query alterations possible.

fago’s picture

Status: Active » Closed (won't fix)
off’s picture

Subscribe

matt2000’s picture

One approach to this idea is in-progress here: http://drupal.org/project/awesomerelationship

Fidelix’s picture