On the block management pages, you can specify and a title will not be created for your block. How can a similar functionality be achieved using Node Blocks? I am not able to create a node without a title as it is required, and anything I put seems to override what is on the block configuration page.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | hide_block_title_feature-1068594-8.patch | 1.69 KB | ericmaster |
Comments
Comment #1
meecect commentedsorry I tried to say above that you can specify
<none>if you don't want a block title. There doesn't seem to be a way to do this with nodeblockComment #2
henrijs.seso commentedHi,
You need to modify themes template.php. If you are using Zen subtheme, uncomment MYTHEMENAME_preprocess_block and place following code in it without first and last php lines
Install devel module and uncomment dsm... line to see under hood of blocks on page.
I added text field with CCK module with title "Hide title" so my users can choose which blocks to show without title and code is as follows
Again, with Devel module installed and dsm lines uncommented, you can see inside node and find your field and adjust code to your needs.
Comment #3
marcvangendThanks mansspams. This code does the same in D7:
Comment #4
michaellander commentedWhile this feature would be nice, currently the Drupal 6 version is only up for maintenance/security/bug fixes. I myself primarily develop for Drupal 7(though I'm going to try and make time for 6), and the other maintainers don't have the time at this time to implement nice-to-haves, unfortunately. I will however keep this in mind for future versions of Drupal 7 module, though other modules such as Display Suite sort of eliminate the need for this specific feature on Drupal 7 because you can just create another view mode.
Mansspams, thanks for helping to provide a simple solution in the meantime!
Comment #5
michaellander commentedComment #6
escoles commentedNote that if you take the preprocess funtion approach, you will be removing node titles from ALL node blocks.
If you will have some nodeblocks where you need to display the node title, you'll do better to create a node template.
Comment #7
holtzermann17 commentedFollowing up on #6, that's block--MODULENAME--BLOCKNAME.tpl.php -- which can be derived from block.tpl.php and put in your templates directory.
Comment #8
ericmaster commentedI needed this feature as well so I made a patch to provide this feature for D7, sorry I didn't have time to back port it to D6 :(
Comment #9
Johnny vd Laar commentedI don't think your patch is made on the new dev version. The new dev version includes a new block title field. Also your patch is not according to Drupal coding standards:
$block['subject'] = $show_title?check_plain($node->title):'';
should be:
$block['subject'] = $show_title ? check_plain($node->title) : '';
Comment #10
Johnny vd Laar commentedYou can now change the block title from the node config, there you can leave it empty.
Comment #11
klonosI tried to manually patch the latest dev version of the module with the patch from #8, but I didn't know what to do with this part:
...because the mentioned existing and removed lines do not exist in the nodeblock.module file (?!).
[edit]: comment moved to #2056143: Nodeblock title not updated when node title is changed.