How to pass values to content creation page to set default values in form elements? Introduction (not necessarily needed to be able to answer the question)
I use Domain Access module to be able to manage different sites from one Drupal installation and a single shared database. I enabled Domain Content submodule that provides a content administration page for each subdomain.
Instead of having all contents of all domains displayed at /admin/content, this allows to display all contents of a given domain at /admin/content/domain-content/mydomain.
What I'd like to do
I'd like to prefill a form element in Create Article page according to a given domain.
So I plan to add a Add content button at /admin/content/domain-content/mydomain, and pass the parameter mydomain from here until, for example, Create Article page.
Then I'll be able to prefill (tick) the right domain checkbox in the Create Article page according the passed argument.
My question
How to pass parameters between the given admin pages to be able to prefill a form in Create Article page?
Altering the form

You should implement the hook_form_FORM_ID_alter. Then, read the parameters like this:

$name = \Drupal::request()-&gt;request-&gt;get('country'); // from param


Then alter the form elements, rewriting the #defatult_value conditionally, like this:

$form['field_country']'#default_value'] = 'my domain specific default';


In the case of a checkbox widget, the #default_value is an array (source):

$form['countries']['#default_value'] = [1, 3];

Passing parameters in general

If your parameters are simple strings, like country: denmark, you could use GET parameters. This answer has the sample code:

How do I create a link?

Passing parameters through the '/node/add' route

This is a special route, it is not so simple.

Method 1: Implementing a subtheme

If you are using the default admin theme ('seven') you would have to create a subtheme, and overwrite this hook, so that your custom parameters are passed:

   /**
     * Implements hook_preprocess_HOOK() for list of available node type templates.
     */
    function seven_preprocess_node_add_list(&amp;$variables) {
      if (!empty($variables['content'])) {
        /** @var \Drupal\node\NodeTypeInterface $type */
        foreach ($variables['content'] as $type) {
          $variables['types'][$type-&gt;id()]['label'] = $type-&gt;label();
          $variables['types'][$type-&gt;id()]['url'] = \Drupal::url('node.add', ['node_type' =&gt; $type-&gt;id()]);
        }
      }
    }


Method 2: Overwriting the twig template

The links are ultimately rendered by the  core/themes/seven/templates/node-add-list.html.twig template. To overwrite this output, you would: 
 - Implement a hook_theme_suggestions_HOOK
 - Copy the node-add-list.html.twig to node-add-list--custom.html.twig and implement your custom changes here.

/**
 * Implements hook_theme_suggestions_HOOK()
 */
function hook_theme_suggestions_node_add_list(array $variables) {
  $suggestions = array();
  $suggestions[] = 'node_add_list__custom';
  return $suggestions;
}