Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- Enable CCK
- Add a field to a node block content type.
- Create a new node block node of that content type.
- Enable the block for the node you just created by moving it to a region.
- Go to admin/content/node-type/[type]/display/nodeblock (where [type] is the nodeblock content type from which you created a new nodeblock).
- Set up display options for your field for the region in which you enabled the block.
Comment | File | Size | Author |
---|---|---|---|
#6 | CCK_build_modes-449942-6.patch | 5.05 KB | rjmackay |
#5 | CCK_build_modes-449942-5.patch | 4.94 KB | rjmackay |
#4 | CCK_build_modes-449942-4.patch | 5.43 KB | rjmackay |
#2 | nodeblock_buildmodes_2.patch | 4.75 KB | q0rban |
nodeblock_buildmodes.patch | 1.89 KB | q0rban |
Comments
Comment #1
zroger CreditAttribution: zroger commentedI 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.
Comment #2
q0rban CreditAttribution: q0rban commentedGood 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.
Comment #3
rjmackay CreditAttribution: rjmackay commentedSeems this has been abandoned.. Any action on this or something similar?
I'd really like to be able to use display suite build modes for node blocks.
I'll try rerolling the patch with the current branch head.
Comment #4
rjmackay CreditAttribution: rjmackay commentedRerolled patch attached. Working with latest 6.x-1.x-dev branch
Comment #5
rjmackay CreditAttribution: rjmackay commentedAdding a -p0 patch so I can use this with drush_make too (but use the patch in #4 with git)
Comment #6
rjmackay CreditAttribution: rjmackay commentedHere's another patch. Also adding a default block build mode, this is used for any region that doesn't have a specific build mode.
Comment #7
michaellander CreditAttribution: michaellander commentedrjmackay,
Thank you for your recent submissions both on this issue and the others. I was added as a maintainer a few days ago to get the Drupal 7 version up and running, however I'll try to find time in the next week to get these drupal 6 changes rolled in. Can you mark any of your own or others that you have RTBC'd and i'll go in and test them and then roll them into the dev branch after testing?
Thanks again for your help.
Comment #8
rjmackay CreditAttribution: rjmackay commentedThanks.
This is in use on a client site so definitely getting tested :)
Comment #9
mrfelton CreditAttribution: mrfelton commentedPatch in #6 is working great for me. In use on production sites.
Comment #10
mrfelton CreditAttribution: mrfelton commentedI'm having a problem with this using it with multiple themes. The config page lets me select the regions that I want build modes for for each theme, and I see them listed in the display suite layout page, but they dont seem to be taking effect.
EDIT: For the default theme, it does seem to take effect, but for other themes, the default 'block' build mode seems to override the one that I set in display suite.