Problem/Motivation
Case example: The section "introduction to linear equations" is used in two different math courses, "math 2b" and "math 2c". The section has quite a bit of resources, such as references to the course books. When viewing the section in the context of a course offering belonging to "math 2b", it would be neat if the resources pointing to the "math 2c" book would be excluded.
Proposed resolution
When viewing a section in the context of a course offering
* Check if the course offering follows a canonical course.
* If so, check if a resource refers to a canonical course (or more).
* If so, check if it refers to the canonical course of the course offering.
* If not, hide the resource.
Remaining tasks
Investigate if this can be done using Views, and without doing really fugly queries.
User interface changes
(as described above)
API changes
–
Comments
Comment #1
itangalo commentedCommitted.
The solution implements hook_views_pre_render() to remove the non-wanted resources. It wansn't really possible to do this within views, since the view uses EVA and not content panes (and thus can't forward information about where the section is being displayed).