I've installed it, now have 2 nodes that can reference each other, I reference one of the nodes from the other node type A, but the node on node type B doesn't do anything.

Is it automatic, do I need to set anything up?

Thanks

Comments

effortDee created an issue. See original summary.

GeraldNDA’s picture

I should probably have made this obvious on the description but this is a code interface for easily getting back references. It doesn't have a default formatter, so you can't see any changes (except via code), however, creating a formatter for this field is not too much work.

The reason a default formatter doesn't already exists is because it would really slow down whole application/site (it would try to render on every entity and then you'd have to go and turn it off -__-).

Check out the README for more info about how to use this as a code interface.
Consider checking out the CER Project (https://www.drupal.org/project/cer) if your goal is just to keep node entity references in sync.
I'm considering adding a default formatter sub-module, so reply if that interests you and I will definitely add a token submodule soon-ish (it's already written I just haven't posted it yet).

GeraldNDA’s picture

Status: Active » Closed (outdated)
demonde’s picture

Is it possible to have a backreference form widget on the referenced item, so I donnot need two reference fields like in CER?

GeraldNDA’s picture

Yeah, you just need to define a formatter (https://www.drupal.org/docs/8/creating-custom-modules/create-a-custom-field-formatter). I would suggest writing your own because a general one gets very hairy for cases where there are lots of reverse references.

In any case, since this was a reply of interest ... I will start looking into working on a submodule that might safely provide this functionality.

demonde’s picture

That would be great.

demonde’s picture

Actually what I am looking for is a dummy field on passive reference such as this widget of the Dr7 relation module

https://www.drupal.org/node/1276338

GeraldNDA’s picture

You could use the Dr8 module for relations ... but I'm not sure if I understand what you are looking for ...

demonde’s picture

There will be no Drupal 8 version of relation.

My use case is similar to using Correspondig entity references but without the need to set up two fields.

So I can have a reference field form widget at the reference that is pointed on.

E.g. entity A is referencing entity B with an entity reference field.

I can set up a new reference from A to B from B.

This is the same approach as the dummy field. You could call it a passive reference widget.

demonde’s picture

My use case is setting up an entity "relations" with a bundle "relationship" with the ECK module.

This bundle has the fields

* Entity Reference A to node type "project"
* Entity Reference B to node type "person"
* Relation Type field with values such as "Project Member" or "Target Group"

I would like to set up the references from the target entities "project" and "person" without having to set up new fields there, so the data stays in the "relationship" bundle.

The actual working alternative would be using CER and setting up additional fields, but I donnot like that approach.

ccshannon’s picture

I have a similar question, perhaps the same issue as @demonde.

I want to have a list of nodes a User has authored, and have that "authored node list" appear as an automatically-populated field in User entity.

I understand the idea of creating a Field Formatter for displaying this list of nodes, but would that somehow make the field available in Manage Fields or Manage Display?

Or, would there be additional work to make it accessible in the Display modes?

Thanks.

GeraldNDA’s picture

Title: How does this work? » Enable Display Modes for Reverse References.
Status: Closed (outdated) » Active

Changing this back to active and renaming to match the work requested ...

What it should look like:
- Some dynamic reference formatters were ported over for use in this module
- You can create new reverse reference formatters if you so please
- You can enable/change the display mode for reverse references in the UI etc. (by default it is off)
- Since this is similar to dynamic references, you can take advantage of some of those techniques i.e. dynamic_entity_reference_entity_view to have different formatters for different entity types
- New/changed dynamic reference formatters will not work for this module. Unless someone can convince me otherwise, I think this is the better choice.

  • GeraldNDA committed f71785e on 8.x-2.x
    Issue #2898132 by GeraldNDA: Enable Display Modes for Reverse References
    
GeraldNDA’s picture

Still need to update the readme ... but that should come shortly.

Please try the dev version to see if this is any good.

  • GeraldNDA committed 02dbcc8 on 8.x-2.x
    Update README to include new configurations
    
    Issue #2898132 by GeraldNDA...
GeraldNDA’s picture

Status: Active » Fixed

I'm marking this fixed and will close this soon unless there's any other comments :)

Status: Fixed » Closed (fixed)

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