Hi!
Nice work done! Yet for me one thing is missing: ability to pass along contextual filter from original view.
The case:
Term Reference field in referenced content that uses Entity Reference view to select terms (via contextual filter). The task is to use terms from the referencing entity, but only once for each term through all referenced content.
Like this:
Node: Term A + Term B + Term C
Reference 1: Term A (could be A, B, C)
Reference 2: Term B (could be B, C)
Reference 3: Term C (only choice)
If I were able to pass contextual filter form Entity Reference view to other view that filters it, task would be done. I think this pattern could be very useful in other cases.
Again, thanks for your work!
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3011546-pass-along-contextual-filters-5.patch | 1.61 KB | suyash.vaidya |
Comments
Comment #2
povoloka commentedComment #3
antonnaviHi, povoloka !
Could you please attach your Entity Reference view YML export file. Also describe a bit more detailed: How passing contextual filter from a parent view to other view filter will help to implement described logic.
Comment #4
antonnaviComment #5
suyash.vaidya commentedRe-opening this issue as I needed this functionality as when using pagination with an ajax request, my "other views" weren't picking up the contextual filter from the URL.
Comment #6
Deno commentedDoes the "other view" parse any contextual filters?
I have set up the filter to get the default value from the URI (node ID from the URI) and it seems as if this isn't working at all. I also tried to use the view of type "attachment", but this doesn't seem to work either.
As for the logic:
I am showing some nodes of the type "choices" to the user that can be included to/excluded from a node of type "container". A bit of java-script, Json:API and ajax magic means that users just need to press the Add/remove button in a view to add/remove the "choices" nodes from the "container" node without leaving the view.
The clue: the table listing "included choices" need a contextual filter on the "container" nid, otherwise they don't know which container to look into.
As I said, I tried with "content ID from URL" default in contextual filter but this didn't work.
Comment #7
Deno commentedIn reality, my view is more complex than that, so I'm not sure if that's of any use as example, but here it comes.
Some explanations:
What this view does is to list the adaptation options that are available for the study (listed in the right Datapackage) and lets users include some of them in the GL-step.
Comment #8
Deno commentedBy the way, this patch works perfectly for me.
Comment #10
antonnaviThank you all for help!
Patch was applied to the module DEV branch 8.x-1.x-dev.