Development Seed Blog

Site Building with Drupal Gets Easier: Context UI

Streamlined, Centralized Drupal Building Logic

Streamlined, Centralized Drupal Building Logic

Last month at DrupalCon Boston I presented with Jeff Miccolis on implementing a formal context system in Drupal. We had a lot of ideas to share and some proof of concept code to demo. Since then we’ve been working hard to clean up our code and our concepts.

The basic idea behind the context module is to allow different parts of the Drupal stack to expose key pieces of logic to other parts in a standardized fashion. Context_ui extends this core functionality by allowing users to create context definitions - bundles of views, content types, panels, menu items, and blocks - that can be used to model “sections” or “features” on your Drupal site, among other things.

The core context module and two add-on modules are available in the Drupal CVS repository. If you are a site builder or a themer you should take context_ui for a spin - it streamlines some of the trickier tasks involved in gluing a Drupal site together. We wouldn’t recommend any of these modules for production use yet as they are all moving quickly. You can grab them here: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/context In the next screencast, we’ll take a look at how other modules can leverage context_ui’s export and override functions to build fully functional module features out of the box.

Comments
Hi. Do you plan to repost

Hi. Do you plan to repost the screencast?

Screencast missing

It appears the screencast is no longer available or has moved, is there any chance to get it back up or provide a download?

I can get to the jing video,

I can get to the jing video, and manually move the playhead, but I don't get sound, and it doesn't actually play by itself.

Context and Panels's context

Seems to be a great module !

I am curious to understand how it feets with panels2. Panels UI, enables the admin to define a specific context for each panel. For example I could build a context based on a node and a user and display all the related information (node content, author profile, list of contribution, etc...).

Could you please explain me what are the differences between both and how one could use the other ?

Integrating with Panels + Views, etc.

Hey Alex, thanks for the compliments.

We've been working on our context module and thinking through our concepts very rapidly on various projects. I know Earl Miles has been developing at a breakneck pace as well on Panels 2 and Views 2. There hasn't been a good chance yet to fully coordinate our efforts together yet, but the concepts we are working with are very similar and I know many module developers are interested in a larger sense of "context" in Drupal that isn't limited to 1 or 2 modules.

So in short -- no integration yet, but look for good things to come.

Great Work

This is great - for one of the Drupal websites I am working on (http://www.italymag.co.uk) we actually have a template function that produces a variable that we actually call context to do some of what your module does but in a far less elegant way. Wonderful work - thanks!

The scalable taxonomy issue is something we came across as well. We have a taxonomy term for every region, province and town of Italy (about 8300 terms) and we found that almost all modules dealing with taxonomy just fell apart when faced with that

wow

Really impressive stuff. Say goodbye to all the "Page specific visibility settings" that I've been writing.

Will the new "context" stuff in Views 2 be able to hook into this?

-mike

wow, thanks for the plug

Wow, great UI (for the module and for the demo site). And, by the way, thanks for the Drupalcon Szeged plug ;)

Also

Also, I'm, once again, extremely jealous of your UI design skills. How about devoting some time to a young_clone.module? I'd be happy to be a beta tester for that one...

Wow...

That just blew me away. I vaguely remember your comment a few months back on a crazy context module that was being whipped up. Very, very cool stuff!

Taxonomy?

Context_ui looks very, very cool. The only thing I'm missing after looking at the screencast is setting the context for node not only depending on the node type, but also depending on Taxonomy, i.e. the term(s) associated with a node.

Would that be possible?

Taxonomy context

Hey Udo,

Yes, it's actually very easy to set context based on taxonomy conditions. There's currently no UI for doing this (I'm trying to come up with a system that will scale), but you could make a simple custom module that implements a hook_nodeapi() and does a context_set() based on $node->taxonomy.

Context_ui provides a block called "context devel" that you can put in your sidebar that will show you what contexts have been set -- you can use this to debug your code.

We'll be posting a screencast for developers on using the core context module and context_ui.

Thanks!

Thanks very much! This sounds really, really promising. I'm looking forward to the screencast.

Very Nice

Great piece of work. I look forward to the stable release. I must say, I'm impressed.

Wow... Simply Amazing

This is truly great work! Thank you so much for sharing it with all of us.

I've been secretly hoping to see this released, since your presentation at Drupalcon Boston. I love the idea of it, and can't wait to use it :)

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <img> <p> <li> <ul> <ol>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options