Pimping the CCK display fields UI

Ever dreamed of having a node template with only this in it: print $content; ? Well, my sandbox site currently runs a patched version of CCK which does the following: order the fields on every display, not when managing them. You are also able to render the fields in what we call node regions. Screenshots and a first patch is available at the end of this post.

Rendering fields

In the UI of CCK we all know right now, it's possible to set the order of the fields on the 'manage fields' tab. This affects the order on the node form and on the full node, teaser etc view. Since the arrival of http://drupal.org/project/nodeformcols, it's easier to have a more finer control of the node edit form and we wanted to have that same control over the full node, teaser, sticky view .. Adding a weight property wasn't that hard to accomplish. You can see that the order of fields is different in those 3 contexts on the sandbox site. We're still looking howto affect search results too ..

Node Regions

To make our themers happy, we added node regions, so it's easier for them play around with the fields while creating their views, teasers, full nodes etc. They can play with 5 regions without having to create one single template file. Only CSS, that's what they were hired for in the first place :) If you look at the sandbox site, you'll see that with those regions, a full view vs sticky looks different, only through the magic of css.

Extra fields

In the version we currently have at work, we are able to add extra fields with custom formatters. It resembles a bit like the 'content_extra_fields' hook you can currently implement. This gives us the benefit to render the title beneath an image for instance. In the next few days, we'll be looking on howto to extend that functionality in the CCK module.


We won't release this as a module or as a fork of CCK, the best way to contribute is to release a patch of course. We're still cleaning up the code a bit, but a first version is available. Apply it against the 6--2 branch of CCK - latest dev will probably work too. As soon as we think the patch is clean, we'll post it in the issue queue of CCK. In the meantime, if you have any questions or suggestions, ping us on IRC (swentel, stalski or zuuperman).


The manage fields now only manages the cck fields.

Display fields now controls the order and the region, here the full node.

Same screen, but now the sticky context.

Shot of firebug where you can see that 3 node regions are rendered.


Submitted by chriscalip on June 29, 2009 - 15:26

Sweet, you would not believe how I did workarounds for this functionality a combo of views-arguments, tpl, and override blocks. This workaround is gonna be good, I am looking forward to it.

Submitted by yschutz on July 7, 2009 - 11:08

I did apply the patch to cck-6.x-3.x-dev: patch -p0 < pimped_cck_ui.patch.txt succesfully (? see below)
When selecting the Display Fields tab, I obtain the old screen with the options Basic Print etc.. not what is shown above.
Did I miss something ?

patching file content.module
Hunk #3 succeeded at 782 (offset 22 lines).
Hunk #4 succeeded at 833 (offset 22 lines).
Hunk #5 succeeded at 899 (offset 22 lines).
Hunk #6 succeeded at 1921 (offset 51 lines).
Hunk #7 succeeded at 2401 (offset 51 lines).
Hunk #8 succeeded at 2676 (offset 73 lines).
patching file includes/content.admin.inc
Hunk #1 succeeded at 554 (offset 2 lines).
Hunk #2 succeeded at 562 (offset 2 lines).
Hunk #3 succeeded at 577 (offset 2 lines).
Hunk #4 succeeded at 605 (offset 2 lines).
Hunk #5 succeeded at 625 (offset 2 lines).
Hunk #6 succeeded at 642 (offset 2 lines).
patching file theme/content-admin-display-overview-form.tpl.php
patching file theme/content-admin-field-overview-form.tpl.php
Hunk #4 FAILED at 35.
Hunk #5 succeeded at 51 (offset 1 line).
Hunk #6 succeeded at 63 (offset 1 line).
Hunk #7 succeeded at 74 (offset 1 line).
1 out of 7 hunks FAILED -- saving rejects to file theme/content-admin-field-overview-form.tpl.php.rej
patching file theme/theme.inc
Hunk #1 succeeded at 1 with fuzz 2.
Hunk #8 succeeded at 89 with fuzz 2.

Submitted by AJ on December 20, 2009 - 15:06

Thanks for the article. It i just for me. As for me,I'm making my first steps in it yet. I've found a lot of really nice books about Drupal at the pdf search engine http://pdf.rapid4me.com and I'm making some progress already. Thanks for clearing some points and additional information.

Submitted by Shane on April 15, 2010 - 20:35

haha I wasn't aware you actually work on DS. Great module btw.

I do have one question though. What exactly does the print build mode do. I assumed it would control the view when printing. But when I print it just prints whats on the page.
Even with normal cck display fields I never understood what the print tab was for.

You are here