0

I have 2 entity types Content type A and B. Content type B has a date field and an entity reference to A.

I need a view that shows all the nodes of content type A But also shows all the referenced content, until this point I have no problem.

The only problem is that the content type B needs a filter to only show the content from this year. But when I add a filter to the date field all the nodes that don't have an entity reference also get filtered out.

Content type A are assets

Fields:

  • Title
  • Address
  • lat/long

Content type B is the maintenance of these assets

Fields:

  • Title
  • Entity reference to A
  • date field

Now I want to show all the assets in a view.( also the ones that don't have maintenance done) In the same view there should be a column with all the maintenance within a certain timespan.

When I have this view i can put these on a google map and show which assets need maintenance and which are already done

  • Did you check this video? – usmanjutt84 Apr 10 '18 at 10:38
  • I already know how to add a date filter. The problem is that all the nodes of type a without an entity reference also get filtered out. – GoempieK Apr 10 '18 at 13:30
  • Did you add any entity reference relationship in views? – usmanjutt84 Apr 10 '18 at 14:02
  • Yes the entity reference from B to A otherwise I cant show fields from the content type B – GoempieK Apr 10 '18 at 14:07
  • You question is a bit confusing so could you please update your question and mention the ultimate output you want. And please attached screenshot if you can. – usmanjutt84 Apr 10 '18 at 14:22
1

As what I understand your needs its very simple.

You have to set the filter criteria in the views:

  1. Add Content Type A
  2. Add Content Type B
  3. Add Published field twice
  4. Add Date Field and set its criteria as you already set
  5. The field (Entity Reference field in Type B) that reference to Type A and set its operator as Is not empty (NOT NULL)
  6. Now, Open re-arrange the filter criteria fields

enter image description here 7. You need to Create new filter group under the filter criteria and drag drop your fields in required group like below

enter image description here

I hope this will at least give you an idea how to filter different content types with different field(s).

Thanks

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.