I'm surprised this doesn't seem to have come up before but how feasible would it be to add the ability to make individual nodes blocks without making all nodes of that content type blocks?

On the content type edit page you could have options for:
* Enable for all nodes of this type
* Enable per node

It isn't that big a deal to have a block content type however it could be a nicer user experience for the site content editors if they were using their normal content types and occasionally some of them could be made blocks.

Comments

rubencausyn’s picture

StatusFileSize
new0 bytes

First version of patch based on d6-patch #603862

rubencausyn’s picture

Status: Active » Needs work
StatusFileSize
new7.72 KB

First version of patch based on d6-patch #603862 (Fixed upload for comment #1)

drzraf’s picture

yeah, I'll test this but right now you can generate the patch using git diff -w to strip whitespace changes. They make the patch far less readable on the essential.

rubencausyn’s picture

StatusFileSize
new4.34 KB
seanb’s picture

Thanks for the initial patch, everything works as expected, except for a small error in the following code:

<?php
      if (isset($node->nid)){
        $form['nodeblock']['settings']['#default_value'] = $nodeblock_nodes[$node->nid];
      }
?>

We need to check if the nid is in the array as well:

<?php
      if (isset($node->nid) && isset($nodeblock_nodes[$node->nid])){
        $form['nodeblock']['settings']['#default_value'] = $nodeblock_nodes[$node->nid];
      }
?>

Could we try and get this committed?

szt’s picture

Status: Needs work » Needs review
drzraf’s picture

I reworked the patch a bit.

  • Addressed the issue of seanB [ I experienced it myself ]
  • Less code in the extra-feature (showing node's title) in nodeblock_block_info
  • changed block's name (starts with nodeblock + check_plain(title)
  • Simplified the condition in nodeblock_form_alter so that the translation_fallback checkbox appears only when it's needed (as it used to).

confirmed it works

Johnny vd Laar’s picture

I will look into this to see if we can incorporate this into nodeblock.

Johnny vd Laar’s picture

Status: Needs review » Fixed

I have added a new nodeblock table to replace the variables that the module set. It also has an enabled checkbox per node.

It's added here:
http://drupalcode.org/project/nodeblock.git/commitdiff/23ab1cb?hp=9fd890...

Please reopen this one if you find a bug in this.

Status: Fixed » Closed (fixed)

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