Hi there,

I think it would be great if it was possible to uncheck the "Enable an availability calendar for this node" checkbox by default.
This would be a great option to use with generic node types where just some nodes require the availability calendar.
Or is this already implemented and I am just missing it?

Comments

fietserwin’s picture

Version: 7.x-3.2 » 7.x-4.x-dev

On one side, it should not be too difficult to implement this, on the other side, we are talking about a default setting. There is no missing functionality, just ease of use for your use case.

Anyway, I will see if it easy to add it to the field settings UI, without further complicating that (already loaded) UI.

naoliva’s picture

Following...

bendev’s picture

you could use hook_node_form_alter

-> test your node type
-> check you add a node and not update an existing node (to not override existing settings)

if (preg_match("/add/i", $_SERVER['REQUEST_URI'])) {
then do a
$form['your_field_name']['und'][0]['enabled']['#default_value']=0;
}

replace und by the $node-language or use wrappers...