1

I have three content types: application, organization, and organization_note. Application has an entity reference to organization and organization has an entity reference to organization note.

The application edit page has an autocomplete field for organization. When a user selects an organization which has a note, I would like the display to be different somehow, ideally a reminder to check the organization's notes.

This question is very similar to this one (unanswered).

I'm at a loss here, and I don't really even know if this is possible. How would I go about doing this? (This is Drupal 7, by the way.)

1 Answer 1

2

You can do this by creating an entity reference view.

Firstly, create a new view that displays the content type 'organization'. Do not add a page, but rather add an 'Entity Reference' display.

enter image description here

Your view should now have a format of 'Entity Reference list'. Now add a relationship to organization_note, and then add the fields that you would like to see in the autocomplete list. When that is done click on settings in 'format', and select the field that you want to search on when typing in the autocomplete. This normally would be title. You can also rewrite the field values to your liking as you would probably need to for your use case, though I would leave title standard.

Now go back to the field settings for 'application', and edit the settings for the entity reference field to organization. In the 'Mode' for the 'Entity Selection' section, select 'Views: Filter by an entity reference view'. This will open a new select from which you select the view you created above.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.