How to move fields into secondary region where Menu Settings are located? We have a need to move the language selector field to right column in the same section as the Menu Setting (see screenshot). Using Twig Debugging, we found that the template node-edit-form.html.twig can be used, but we could not find a way to selectively move select fields such as the language selector. We did notice a Secondary Region in the twig template, but could not see a way to selectively move the field so that if the field exists on the content type.

Goal:


Add language selector to the secondary region. 
No additional styling is needed, just move the field. 




How do we move the fields to the secondary region on the node-edit page??
This can be done in two ways:

1) Use the Field group module.

Field Group has added the ability to move items to the right sidebar on the node edit form, via the "Details sidebar" group type in the dropdown.

2) Write a hook_form_alter() in a custom module.

If you have more complicated needs than what Field Group provides you can do this in custom code.

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // Select the desired entity add/edit form.
  if (is_array($form['#theme']) &amp;&amp; in_array('node_form', $form['#theme'])) {

    // Ex 1. Move an existing field container wrapper to the sidebar.
    if (!empty($form['field_myfield']) &amp;&amp; $form['field_myfield']['#type'] == 'container') {
      $form['field_myfield']['#type'] = 'details';
      $form['field_myfield']['#group'] = 'advanced';
    }

    // Ex 2. Move an existing field to the expanded 'meta' section of the sidebar.
    if (!empty($form['field_myfield'])) {
      $form['field_myfield']['#group'] = 'meta';
    }

    // Ex 3. Move a field group provided by some contrib module to the sidebar.
    $form['somecontrib']['widget'][0]['#group'] = 'advanced';
    $form['somecontrib']['widget'][0]['#open'] = FALSE;

    // Ex 4. Create a custom collapsible container in the sidebar.
    $form['mycontainer'] = [
      '#type' =&gt; 'details',
      '#group' =&gt; 'advanced', // This line places the container in the sidebar
      '#weight' =&gt; 99,  // ensure it displays last or use -10 to show it first.
      '#title' =&gt; t('My custom sidebar settings'),
      '#tree' =&gt; TRUE,
      '#access' =&gt; TRUE,
    ];

    // Ex 4.1 Move a field into the custom container in the sidebar.
    if (!empty($form['field_myfield'])) {
      $form['field_myfield']['#weight'] = -1; // reset weight 
      $form['field_myfield']['#group'] = 'mycontainer';
    }

    // Ex 4.2 Some fields have an inner widget that need to be moved instead.
    if (!empty($form['field_myfield']['widget'])) {
      $form['field_myfield']['widget']['#weight'] = -1; // reset weight 
      $form['field_myfield']['widget']['#group'] = 'mycontainer';
    }

  }
}