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


RSS Icon Subscribe to comments

You need to login to post a comment.