Opening this with the intention of spinning off sub-issues, rather than posting patches.
The current d7ux site builder prototype has as a reasonably central concept the idea of a page template which you can pull stuff into (stuff including view, a node, a user profile, some blocks). The idea being you set up your page by choosing bits and pieces to go on it, not make bits and pieces which eventually find their way into a page.
At an architectural level, this completely inverts how the core page + blocks system works at the moment. Currently, you enable (or create) a block, then define the paths it appears on (and in reality a bunch of other visibility rules like language, role etc.). We need people to be able to create a page template first, then define the blocks or other content which appear on it. This is a lot like what Panels does already.
I've discussed this a bit with merlinofchaos, and here's vague thoughts on how we could start making this shift (NB, these are my thoughts, don't blame Earl for them). I think this shift is one we should probably make anyway regardless of d7ux work.
The main issue, which our current blocks system is completely inadequate for without a lot of really nasty hacks, is knowing what kind of page you're on and doing stuff based on that, rather than loading everything (and displaying it in a big long list), then whittling down based on various arbitrary criteria.
In terms of layouts, here's what (I think) needs to happen. We're assuming that people are defining layouts integrated with the sitemap tool:
1. If there's a layout defined for this specific path (node/1 layout) load the stuff (including content block) for that path
2. If there's a layout for this wildcard path + bundle (node->type layout) get me the stuff for that.
3. If there's a layout for this wildcard path, get me the stuff for that (node/% default layout)
I think this maps pretty closely to existing/upcoming core concepts which currently have nothing to do with blocks at all:
function node_fieldable_info() {
$return = array(
'node' => array( // cross reference to menu_get_object() and node/node%
'name' => t('Node'),
'id key' => 'nid', // node/1
'revision key' => 'vid',
'bundle key' => 'type', node/% but per-type
),
);
return $return;
}
Given user.module currently exposes similar information about itself, and taxonomy.module will hopefully do the same for terms soon - that's 95% of pages in core covered. We probably need a 'container' entity as well which you can just put stuff on (for landing pages etc.) - and obviously contrib needs to be able to provide their own.
In terms of fallbacks this means:
1. the specific path
2. an entity type + bundle
3. the entity type
The {menu_links} table can handle 1 - lets you add an entry for any arbitrary path (more or less), and happens to also come with hierarchy and drag and drop which is the entry point for the site builder.
The menu_router table + loader functions handles 2 and 3 more or less.
So the initial task as I see it is getting the panels/ctools/context.module idea of 'context' into core. We already have info hooks which describe possible contexts in tandem with menu loaders, and these hooks will be generalized once #460320: Standarized, pluggable entity loading (nodes, users, taxonomy, files, comments) gets in. The next task is finding a storage mechanism which will let us associate a template with a context (id/path, bundle, entity type) efficiently - and then also defining which things are available to which contexts (I can't add a related terms block to a node - so why bother showing it at all?).
This is all a bit woolly, but there you go. I think we need a parallel effort on how page templates themselves get defined, how the interface for adding pieces/blocks/widgets to a page will look - but these are somewhat parallel issues at least to start with.
Comments
Comment #1
damien tournoud commentedComment #2
catchComment #3
stevectorI think this is all covered under WSCCI/SCOTCH now: http://groups.drupal.org/wscci http://drupal.org/sandbox/eclipsegc/1441840