There is the great new feature "Overrides per node" with "Available as block".

It would be great that on creating a node, where you can choose to provide a block on per node level,
this option was turned off as default. This way blocks are only created as an opt in, where there are needed.

This appears to me more logical from design.

By Coding simply change the default value from TRUE to FALSE in Line 186 in nodeblock.module like here

        $form['nodeblock']['enabled'] = array(
          '#type' => 'checkbox',
          '#default_value' => isset($node->nodeblock) ? $node->nodeblock['enabled'] : FALSE,
          '#required' => FALSE,
          '#title' => t('Create a block for this node'),
          '#description' => t('Should a block be created for this node?'),
        );
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klonos’s picture

Title: Change default value of "Available as block" on the node form » Provide an option to set the default value of "Available as block" on the node form to either on or off.
Version: 7.x-1.4 » 7.x-1.x-dev

I on the other hand find it useful to have it the other way around: default to be turned on and have users opt-out. So, how about we settle for having a Default behavior drop-down menu that appears conditionally (only when the Available as block option is checked) and it provides two options: on/off?

klonos’s picture

...alternatively, it could be a single drop-down with these three options:

- Disable
- Enable, default to on
- Enable, default to off

Johnny vd Laar’s picture

I think #2 is a good solution. I'll add this when I find time.

klonos’s picture

Title: Provide an option to set the default value of "Available as block" on the node form to either on or off. » Provide an option to set the default value of "Available as block" on the node form to either on or off - default to on.
legolasbo’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
3.57 KB

No need to find time Johnny, attached patch adds the mentioned solution.

legolasbo’s picture

FileSize
4.09 KB

I just realised I haven't updated hook_uninstall to remove the newly added variable. While adding a line to remove it, I also discovered that the original overrides variable wasn't being removed either. Attached patch fixes both issues aswell.

TechNikh’s picture

Patch in #6 works for me. Thanks legolasbo

Johnny vd Laar’s picture

Status: Needs review » Fixed

I've modified your patch a little bit, if you where using the patch then you'll need to resave the content types because the dropdown has different values. I kept the checkbox because of backwards compatibility and I added some states.

http://cgit.drupalcode.org/nodeblock/commit/?id=a38d5c3

Thanks for the work!

Status: Fixed » Closed (fixed)

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