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

reblutus created an issue. See original summary.

reblutus’s picture

Issue summary: View changes
ufku’s picture

Priority: Major » Normal
Status: Active » Fixed
Issue tags: -form, -Block plugins

The stackexchange link seems to have a good example for this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.