5

When you are watching a page, is there a quick way for seeing all of the contexts that are being applied? Ideally I would like to be able to see which context is responsible per the blocks.

4

You can use the active context api to get this done.,

$contexts = context_active_contexts();
print_r (array_keys($contexts));

Place the above code in your form_alter or in any hook_node_view. This will list the active context in the page.

1

Apart from using the Devel module as suggested in the previous answer, there is also the Devel Catcher module (which has Devel as a module dependency).

Here is an excerpt from its project page (why you may want to consider this module):

... aggregates or "catches" all development debug info into one easy to access place.

Similar in style to Firebug or Chrome's Inspector. Devel Catcher intercepts common debug info into a tabbed interface as opposed to having to assign debug blocks to a region or dumping the output at the end of your HTML document.

Currently Devel Catcher can catch the query log from the Devel module, node access rules from the Devel Node Access module and the context inspector block from the Context UI module.

Another way to look at this: it enhances your "debugging" experience (hm, hm ...).

0

If you have the Devel module enabled it provides a block called "Context Inspector" which you need only place in a region on your page in order to see the current contexts output via Krumho.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.