It would be great if you could add an how to for how to integrate the IMCE for a custom block plugin in the readme.
public function blockForm($form, FormStateInterface $form_state){
$config = $this->getConfiguration();
// todo make this IMCE
$form['background'] = array(
'#type' => 'managed_file',
'#title' => $this->t('Background'),
'#description' => $this->t('Enter background image'),
'#default_value' => isset($config['background'])?$config['background']:'',
'#upload_location' => 'public://backgrounds',
'#weight' => '2',
);
}
ref: http://drupal.stackexchange.com/questions/218674/how-to-enable-imce-in-a-field-of-a-custom-block
Comments
Comment #2
reblutus commentedComment #3
ufku commentedThe stackexchange link seems to have a good example for this.