Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
fietserwinOn 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.
Comment #2
naoliva CreditAttribution: naoliva commentedFollowing...
Comment #3
bendev CreditAttribution: bendev commentedyou 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...