I noticed today that the cck block display settings are overriding the basic display settings. For instance I have field_1, on the basic display settings I have it set to hidden so that it does not render in $content. But I have the display setting in the cck_blocks display settings as default. What I end up with is field_1 displaying in $content and in the cck block that I have added. I'll see what I can dig up to help resolve this.

#24 cck_blocks_conten_view-833730-24.patch1.48 KBkevee
Members fund testing for the Drupal project. Drupal Association Learn more


not-anymore-used-9999’s picture

Thanks for your report!

Have you used cck_blocks 6.x? If yes, have you seen the issue in that version? I'm using 6.x on several sites myself and never had a similar problem. For that reason I'm very sure, that it is a 7.x-only issue.

I'm not able to investigate this issue before August. I'd really appreciate if you could gather more information about that topic.

gleroux02’s picture

Yes, I have used cck_blocks 6.x and did not see this issue. I think it was because in 6.x at least the last version that I used the display setting was set in the block itself. I like this approach better and think that it makes more sense, ie setting it in the display settings on the content type. I will definitely see what I can dig up for the reason why this is happening. I'll let you know what I find out.

gleroux02’s picture

Ah, ok I see the culprit. Although I am not sure yet what can be done about it, or if this should be more of a feature request for when you have a chance to work on this again. So it looks like in cck_blocks_block_view the node get's built out using node_build_content($node, 'cck_blocks') which allows the display settings from cck blocks to be applied and the proper blocks built. The issue for my case is that the display setting for the block needs to be different from what is in $content. And it looks like that is not possible since it is rendering the node with the cck_blocks display settings. Either way for now I have a solution which is to just hide($content['field_1']) in my node.tpl.

nadavoid’s picture

Version: 7.x-1.x-dev » 7.x-1.0

I'm seeing this issue in the cck_blocks 7.x-1.0. Updating version to 7.x-1.0 because it was released more recently than the 1.x-dev.

Azol’s picture


lonester’s picture

I've been seeing the same issue this past week. I have no insight into how difficult this is to resolve, but I'd humbly suggest it is a bug rather than a feature request, as I can't think of an instance (others may be able to) where I'd want to display each CCK block field twice (once in blocks, once in the node).

I'll try the solution as recommended above (thanks gleroux02!) and hope it works. It is a very useful module btw, as I can use it to achieve the same effect in Drupal 7 that would otherwise require the (currently) dev versions of Views, Panels and CTools.

agileadam’s picture

Confirmed. I'm having the same issue.

hansfn’s picture

Confirmed. Subscribe.

thommyboy’s picture

i've got an issue with the 6.x version http://drupal.org/node/1053130 could it be related to this issue?

tbcorb’s picture

I'm having the same issue, which was temporarily fixed by gleroux02 suggestion in comment#3 (thanks!). Wasn't the option added to version 6 that allowed visibility in the main node to be turned on or off as an option (with the default being "on"). This default seems to have been ported over to version 7 without an administrative interface to turn it off. (Love the module, though!)

Wolfgang Reszel’s picture


hedley’s picture

Same issue with 7.x-1.0 the hide($content[field_1]) in node.tpl.php workaround is doing the trick for me.

Just a note for others, I got 'undefined index' errors as I put the hide() in a generic node.tpl.php so I created a more specific node--page.tpl.php which solved the problem.

brucebertrand’s picture

remember to enclose the name of the field in quotes so you don't run into undefined constant error messages.

hedley’s picture

This is the code I've ended up using:

if(isset($content['field_image'])) {
Scott J’s picture

That's weird. I've just noticed this behaviour. I was sure that it used to work as expected.

olbion’s picture

Same issue for me. Would be great if there was a proper solution. This is a nice module

duvrai’s picture


federico.giunchi’s picture


Azol’s picture

Display Suite offers exactly the same functionality, creating the blocks for fields and correctly displaying them in regions of your choice while hiding them from main content. Moving off to DS for the present.

servantleader’s picture

Confirmed. Same problem with 7.x-1.0 and dev. Makes this module useless because I don't want the filed displayed twice.

momentuminc’s picture

I'm having the same problem.

momentuminc’s picture

I'm having the same problem.

Ali.T’s picture

same issue here.

Adding the hack to node.tpl worked for me.

if(isset($content['field_banner_img'])) {
kevee’s picture

Status: Active » Needs review
1.48 KB

Attached is a patch that uses the actual field build process, instead of a full node build call. This appears to fix the problem on my end, and leaves the "could be in both a block and as content" option available as well.

not-anymore-used-9999’s picture

Thank you all for your reports. As I'm very busy at the moment, I'm unable to test the patch myself. Could someone please test it and report the results back in here?

I'll hope to find some time to include the patch in a new dev version.

Scott J’s picture

Works for me.

hedley’s picture

Yes the patch in #25 is working well for me as well

damien_vancouver’s picture

patch in #24 works great for me too, nice work kevee!

after applying using "git apply cck_blocks_conten_view-833730-24.patch" in my cck_blocks dir, the layout and visibility settings from "CCK blocks" no longer override all the other view mode settings in Display Suite (ie. Default, Full Content, Teaser, etc). Yet my CCK blocks settings are applied to my CCK blocks. Perfect!

As I'm the third to report success with that patch, I'm setting it to reviewed & tested by the community and version to 7.x-1.x-dev... maybe it can find its way into 7.x-1.x-dev ?

jmix’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community


sorry, i'm tottally new to drupal and i don't understand how to apply this patch for CCK Blocks !
Is there a "git" module or something like that ?
Thanks for helping !

acrollet’s picture

Patch in #24 works well for me too, any chance of getting it committed? thanks much!

kevee’s picture

Every project has a Git instructions page (this one is at http://drupal.org/node/192744/git-instructions), which includes information on applying patches. Git is a version control system, it's not a module for Drupal.

edlvox’s picture

Hi everyone, patch #24 works as said... would be great if gets committed...


beauz’s picture

Hi, having same problem can we get the patch committed??

Alex Regenbogen’s picture


crispinbailey’s picture


NancyDru’s picture


hedley’s picture

Patch in #24 works perfectly for me against 7.x-1.0

amirtaiar’s picture

Patch in #25 working grate, thank you.

thommyboy’s picture

could the code of the patch work in 6.x-1.3 too?

d21anthony’s picture

I found something for all the noobs like myself that are or could be having an issue working with git. I'm not totally sure it's a conventional method but it works and is fairly easy. Check it Out! it will save you hours probably http://drupal.org/node/620014

selfuntitled’s picture

Just wanted to confirm the patch worked for me - took a few seconds to realize that hiding the field label in display doesn't also hide the block title. As soon as I figured that out, and set the block title to everything looked as expected.

rooby’s picture

Seems to work for me too.

andypost’s picture

Status: Reviewed & tested by the community » Postponed

Issue depends on mainteiner's feedsback for git access

there's a call to co-maintain #1353792: Request for Drupal administrator to give damien_vancouver GIT access
and request for git access #1320044: available to co-maintain cck_blocks for Drupal 7

+++ b/cck_blocks.moduleundefined
@@ -98,22 +98,21 @@ function cck_blocks_block_view($delta = '') {
+      $built_nodes[$nid] = field_attach_view('node', $node, 'cck_blocks', $node->language);
+    ¶

Trailing whitespace

rooby’s picture

Status: Postponed » Reviewed & tested by the community

I say leave this active. Postponed issues can sometimes have a habit of getting lost.

This does not really fit in with the usage of postponed at http://drupal.org/node/156119 as it is a valid issue that has no blockers and the maintainer could still commit it (even if that is unlikely).

damien_vancouver’s picture

Actually it is now likely again! I expect to be added as a co-maintainer within the next 24hrs, and the first thing I will be doing is cleaning up this patch, applying it, and then making a 7.x release out for download ASAP. I'll go through all open issues and make sure there are no other bugs that I can fix as well.

I've personally been using the module for 6+ months and it works great (once this patch is applied). It is definitely stable enough for a release.

andypost’s picture

@damien_vancouver aftre applying the patch please clean trailing white-spaces

damien_vancouver’s picture

Status: Reviewed & tested by the community » Fixed

Committed at last!

In 7.x-1.x-dev now, and will be in 7.x-1.1 release (coming soon).

thommyboy’s picture

sounds great that there is a solution now! how about the 6.x version? i've got an issue there http://drupal.org/node/1053130 and was said it's related to this one here?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.