1

In d8.4:

The Published checkbox field, which is part of the publishing options set of fields, is displaying at the bottom of the node edit form instead of with the other publishing options fields.

See screenshot:

enter image description here

I've tried reposition using the Field Group module and also unsetting the form with unset($form['options']['status']); and other variations with no success.

All I'd like is for that field to be included in the promotion options fieldset with the rest of the options.

The field is displaying in div.layout-region-node-footer - I' can't track down where that themeing is taking place.

Any help would be appreciated.

1

NodeForm.php defaults the position to the 'footer' group:

$form['status']['#group'] = 'footer';

In a custom module or your theme, this can be set to the 'main' section:

/*
* Implements hook_form_BASE_FORM_ID_alter()
* @param     Array $form, Object $form_state, Array $form_id
* @return    Array $form
*/
function MY_MODULE_form_node_form_alter(&$form, FormStateInterface $form_state,  $form_id) {

    // NodeForm.php defaults this to 'footer'.
    // Set to 'main' so we can reposition it in 'Manage form display'.
    $form['status']['#group'] = 'main';

  return $form;
}

After this, it can be repositioned in 'Manage form display'.

  • This resulted in my case a WSOD for node/add .. Did try adding as a custom module. How can i add this in my theme? – MatthijsG Mar 16 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.