Context condition for Parent node of node has term #1053
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub Issue: Islandora/documentation#2348
Release pull requests, etc.)
What does this Pull Request do?
Defines a context condition useful for displaying a navigation block for compound objects, by testing to see if the current node's parent has Model=Compound object.
How should this be tested?
On a repository with a compound object with several children, create a context (say, "Compound object navigation") that has condition "Parent node for node has term with URL", set Term=Compound object, Logic=And, Negate=false. As a reaction for test purposes, show block "Context inspector" on the page.
Alternatively, you can choose to create a view block that takes current node id as contextual filter (default content ID from URL), and uses two relationships based on
field_member_of
to first reference the parent item, then to list items that have the same parent. Display this view block as the reaction in the context above.If you visit the compound object, you should see no block reaction, but if you browse to the compound object's child node(s) you should see the block reaction.
Documentation Status
Additional Notes:
Only lightly tested so far, e.g. it should fire if any of the parents of a node with multiple parents has a matching term.
Interested parties
@Islandora/committers