0

I have content type Band and content type Performance. Performance has a reference field to the Band. Both content types have a media field where you can attach photos and videos. What I am trying to do is have the files from a specific Band and its Performances show up in a section (view) in the Band page. And I also want to sort them based on the Date each of the files has in its field.

All my efforts so far have been in vain. Tried to make this work with a content type view and with a file view. I feel like I will have to work with reference filters but again I can't seem to figure out how these work. I have been searching for far too long.

Any tips?

Update

Here are two screenshots of two attempts that managed to manually bring the results I am looking for, but don't really feel right.

Attempt #1

Attempt #1 tries to filter the performances and bands by taking the band name into a filter (performances have the auto label feature that adds the band name in their title). However if I have a band called "lost" and another one called "lost in space" I think I can't filter them correctly.

Attempt #2

Attempt #2 uses two reference filters (this is the first time I tried to do anything with reference filters so I guess I am using them wrong in the first place). The first reference filter brings the band node and the second brings the same band's performance nodes. If I put the node id in the preview filter below I get the correct results. However in this case that view does not accept a node id as a contextual filter because it's a file view. If I try to put a contextual filter it automatically binds to the relationship underneath it and then the reference filters don't work.

It won't let me post the reference filter views, but they are pretty basic. One takes the band id as input and renders the... band id (monkey patching at its best). The other takes the band id as input and returns the band's performances ids as a reference filter list.

4
  • Issue is I want to sort them based on the Date each of the files has in its field Is this what your question is really about? So you have been able to at least display files from a specific Band and its Performances on their band page?
    – No Sssweat
    Aug 7, 2017 at 4:31
  • Hi @NoSssweat. Thanks for the note, i edited my question. You are right that part has been a huge pain as well. I kiiind of made it work, with two separate reference filters, but the way I set it up can't really work, so I guess it's wrong. Looking for a legit way to achieve this.
    – Tashows
    Aug 7, 2017 at 21:12
  • Would be also helpful if you post a screenshot of your view settings.
    – No Sssweat
    Aug 7, 2017 at 21:37
  • @NoSssweat updated the question. Thanks for the time, I appreciate it.
    – Tashows
    Aug 8, 2017 at 9:50

1 Answer 1

0

Here is a different approach, give this a try:

  • Ok, get rid off all the FILTER CRITERIA except for File: type = image
  • Under Advanced, add RELATIONSHIP of [Your Entity Reference Field Name] make sure you select the one that says, "Referecing" and NOT "Referenced".
  • For your FIELDS File: name and Content: title, click on them and for relationship select your Content Referencing Content from [Your Entity Reference Field Name]

enter image description here

  • Under Advanced, add a CONTEXTUAL FILTER of nid.

    • Select provide default value
    • Content ID from url (This will automatically pick up the nid (node id) from the Band node/page.

enter image description here

  • Lastly, would be to add SORT CRITERIA and add the date field.
1
  • That sounds good if I want to show the files from just the performances, which I already can do. The difficulty I have is in showing files from the Band AND files from the Band's Performances at the same view.
    – Tashows
    Aug 9, 2017 at 11:28

Your Answer

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

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