1

I cannot work out some basic stuff ... what do I not correct? Using D8, distribution varbase.

I would like to create a reference from one content type to antoher in D8 so a user is able to use a select box by module chosen (https://www.drupal.org/project/chosen)

I looked up different post but cannot find the problem. The latest QA is followed is: How to create a select box field to select from a filtered list of articles? or also this post How to create a view type of Entity reference display?

So I did I create a view

- Add Display Entity Reference
- Format:Entity Reference list | Settings with content: title
- Show:Entity Reference inline fields | Settings with content title.

Then I add some fields as well. The result is a list of education Clear cache, did drush CR.

I goto to the content type I would like to have the reference (e.g. student). Add a field and would like to add this view a a selectbox to object student.

I should be entity reference the in the reference field I select Views with a filter reference. But every time I get the message here...

No eligible views were found. Create a view with an Entity Reference display, or add such a display to an existing view.

The view list displays: Nascholingsactiviteit voor leden - Entity Reference Source

I made another view for testing purposes but no result of that as well.

I tried other fields but i cannot get it working. I though this is all in D8 core now... Any suggestions?

  • Which Drupal version exactly are you using? There still may be bugs with using the Entity Reference display in the older 8 versions. Is your Entity reference Display of the correct type? For example if you want to reference students (who may be user entities) from Education content (which may be node entities) then you need to create a Views Display of type User. Does your Views Display type match the Entity reference field settings options? I've never used the module Chosen. Does it work if you don't use the Chosen widget? – prkos Jun 30 '18 at 7:44
  • Using Varbase 8.4.21 which include Drupal core 8.5.3 Yes the view contains nodes and is therefore from the correct type. – Justme Jul 1 '18 at 10:52
  • Can you give more explanation on this one: Does your Views Display type match the Entity reference field settings options? – Justme Jul 1 '18 at 10:53
  • I did not use the chosen module yet .. only all is drupal basic stuff – Justme Jul 1 '18 at 10:53
  • It does sounds like a mismatch in configuration, if it's not the Chosen module or Varbase specific. It would be great if you post screenshots of the Views ER Display configuration, and of your ER field settings (edit the Question to add those in). – prkos Jul 1 '18 at 17:05
0

I solved it by chosing content as a reference. After that the options are the same but then it is displaying the view and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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