Trigger a Drupal Context programatically


/ Published in: PHP
Save to your folder(s)

It's not immediately clear from the `context_set()` function how to trigger a context to be "active" using code. Do it like this:


Copy this code and paste it in your HTML
  1. $context = context_load('context_name');
  2. context_set('context', $context->name, $context);

Report this snippet


Comments


You need to login to view comments.