Sadly, no one has yet created a plugin for the Context module that would allow one to set a condition based on a node's parent (as set with Node Hierarchy). Would anyone be interested in taking it on? It would be great to see these two fantastic modules working together.

Comments

ronan’s picture

+1 on this feature!

Patches for this would be most welcome, but if none come I'll try and take it on at some point. Probably during my next D7 site build.

jgj’s picture

Assigned: Unassigned » jgj
Status: Active » Needs review
StatusFileSize
new8.99 KB

This sounded like fun, not to mention useful, so I put something together. Not sure if it's exactly what you're looking for, but it's working on my end.

This adds two context conditions, one for parent node and one for parent node type. The parent node condition uses an autocomplete field to select a node. Currently it only looks for the primary parent and you can only select one node per context. Perhaps it would be better to offer the user the ability to select multiple nodes for a single context? And/or search the whole parent tree. Perhaps that last one should be a separate condition.

I'm new to this whole git patch thing so hopefully this works. Cheers.