Add CCK build modes per region

q0rban - April 30, 2009 - 19:16
Project:Node Blocks
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

The attached patch adds a new tab called 'block' under 'display fields' when CCK is enabled. Under block is a listing of all the regions, and if you have fields added to your block nodes, settings for each region. When a node is displayed as a block, it checks the region that the block is being displayed in and sets the appropriate build mode for that region, outputting the fields as you've selected for that node type.

To see what I mean:

  1. Enable CCK
  2. Add a field to a node block content type.
  3. Create a new node block node of that content type.
  4. Enable the block for the node you just created by moving it to a region.
  5. Go to admin/content/node-type/[type]/display/nodeblock (where [type] is the nodeblock content type from which you created a new nodeblock).
  6. Set up display options for your field for the region in which you enabled the block.
AttachmentSize
nodeblock_buildmodes.patch1.89 KB

#1

Roger López - April 30, 2009 - 20:17
Status:needs review» needs work

I love the direction this is going.

The one problem I encountered is when using an admin theme, the list of regions are for the admin theme, not the site default theme. This could also present a problem for sites using multiple themes in the front-end as well.

There is also a slight UI problem when using a theme with many regions. The horizontal scrolling on the display fields form is a little much.

Great start. Lets figure out how to get this to work properly.

#2

q0rban - May 4, 2009 - 20:48

Good point, hadn't thought of that.

Ok, try this on for size then. Adds a setting page to specify which regions for each theme should be available as CCK build modes.

AttachmentSize
nodeblock_buildmodes_2.patch 4.75 KB
 
 

Drupal is a registered trademark of Dries Buytaert.