How do I share configuration between custom admin form and node type edit form? I have a module that requires some settings per content type. The module is to also provide one admin page where all the settings can be applied across content types at once. 

Essentially I'm trying to share configuration information between a custom Admin Settings form and the node type edit form. I had this all working with Drupal 8 Beta 10 or something like that, but I'm trying to get it working with the latest stable release (8.0.4).

I originally used the method described here for my custom Admin form using the following code: 

$config = $this-&gt;config('mymodule.settings');
'#default_value' =&gt; $config-&gt;get('my_setting'),


Similarly, for the node edit form alter function, I used:

$config =  \Drupal::config('mymodule.settings'); 
'#default_value' =&gt; $config-&gt;get('my_setting'),


But the above stopped working for the node type settings form at some point, so I started looking at using Third Party Settings: 

$node_type = $form_state-&gt;getFormObject()-&gt;getEntity();
'#default_value' =&gt; $node_type-&gt;getThirdPartySetting('mymodule', 'setting', 'default_value'),


This works great for the node type edit form, but I don't know of a way to pull the third-party settings into my custom Admin form partially because getEntity() method isn't available. 

So my question is, what is the best practice for sharing configuration settings between a custom admin form and the content type edit form?
So the bottom line appears to be that Third Party Settings is a great way to handle content type settings without really caring which content type you're dealing with, but there doesn't seem to be a way to get this working with a custom admin settings form for the reason described in the question. 

If I didn't want to have a separate configuration form that handled the content type settings for all content types on one form, I would definitely have used Third Party Settings. However, since I had this extra requirement, I wound up fixing whatever broke along the journey from D8 beta to stable release. 

Now the node type gets included with each of the desired settings using the following code:

function mymodule_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &amp;$form, FormStateInterface $form_state) {
  $node_type = $type-&gt;get('type');
  $config = \Drupal::getContainer()-&gt;get('config.factory')-&gt;getEditable('mymodule.settings');
  $config-&gt;set('my_setting_'.$node_type, $form_state-&gt;getValue('my_setting'));
  $config-&gt;save();
}