Set context_key based on parent context_key

Checks the parent resource for context_key value, rather than assuming 'web'.