The drop is always movingYou know that saying about standing on the shoulders of giants? Drupal is standing on a huge pile of midgetsAll content management systems suck, Drupal just happens to suck less.Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]Drupal makes sandwiches happen.There is a module for that

The Grand unification Theory of Callbacks

Submitted by nk on Wed, 2008-10-08 22:02

After reading Merlin's thoughts on how we need to remove menu_rebuild and replace it with a more straightforward approach, reading the hook_blocks issue, discussing page rendering with pwolanin, pondering on my own thoughts for pipes, liking the canvas-PAC concept that Crell described, here is something big.

On every page request, we create a context. This context contains the path, the loaded objects based on the path, the current user, can contain the rendering mode... Then we call around "hey! here is this request context. I need answers". The answers will be "here is a piece of content. It's configured to go into region X". For speed purposes, I guess we will have "context match" callbacks so that we do not need to call every single former block and page callback on every request. One trivial example is path matching -- notice how block and menu does very similar things for paths. We can then have permission checking -- once again, menu has that with the default access callback and block does something quite similar. And then we could define a node type checker -- it'd be a rather popular one and I guess a very simple one so it's core material. And of course, you would be able to provide new ones. Obviously, these matches all needs to be able to ANDed together.

One last note: currently, on a node type save we rebuild the whole menu router table which is a terrible waste. We could instead just let code hook on the node_type hook and adjust which contexts they want to match. I think the navigation menu based on the router items need to die, it's not a good concept anyways and causes a lot of trouble.

Commenting on this Story is closed.

Submitted by Gábor Hojtsy@dr... on Wed, 2008-10-08 22:40.

Well, the fine folks at Development Seed even implemented something like your vision on the UI level: http://drupal.org/project/context You just define blocks based on context, not paths :) A forum context is all forum index pages plus any forum topic for example, which you have no way to catch by path patterns themselves.

Submitted by alex_b on Thu, 2008-10-09 13:50.

If you check out the context module, you'll see that it's a bare bones module that pretty much just defines how to set / get context information.

Then take a look at another module in the context package: context UI - it implements the

"hey! here is this request context. I need answers"

part of what you're talking about in your post.

What context UI does best ATM, is defining block configurations that you can trigger if a specific view/node/node type/role etc. is present. Just this feature drives down development time significantly at our site builds.

Of course, not just block configuration but any type of response to a given context is possible. Specific needs? Implement a simple hook and there you go.

I'd love to see Drupal supporting a concept of context along these lines.

-alex

Submitted by Anonymous on Fri, 2009-07-31 04:38.

/*
* @(#)Blah.java 70-562 exam 1.82 99/03/18
*
* Copyright (c) MB2-631 exam 1994-1999 Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun. 642-655 exam
*/

Submitted by Anonymous on Fri, 2009-09-11 23:35.

NICE POST

Submitted by Anonymous on Thu, 2009-09-17 17:19.

it was a quite informative article... it was very difficult for me to understand but i think now I'm getting something after reading this stuff.........

california contractor insurance

Submitted by lekii on Wed, 2009-10-14 15:03.

Tiffany Jewellery offering bangle jewelry, bracelet jewelry, eardrop jewelry, necklace jewelry, ring jewelry, finger ring jewelry and earring jewelry
Tiffany Necklaces
Tiffany Bracelets
Tiffany
Tiffany Style Silver Jewelry: Rings, Earrings, Necklaces, Bracelets and more Tiffany Jewelry at low prices
Tiffany and co
Links of London, the leading British contemporary jeweller was founded in 1990 by jewellery designer Annoushka Ducas and her husband John Ayton. Excellent craftsmanship, generous tactile forms and the use of the finest materials remain integral to each collection.
links of london store
links of london