Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $form['content_link'] = [
- '#type' => 'container',
- '#parents' => ['content_link_wrapper'],
- '#weight' => -3,
- 'widget' => [
- '#title' => t('Content Link'),
- '#description' => t('The content to be linked in the menu.'),
- '#field_name' => 'content_link',
- '#field_parents' => [],
- '#required' => TRUE,
- '#parents' => ['content_link'],
- '#tree' => TRUE,
- '#id' => 'edit-content-link',
- '#type' => 'details',
- '#open' => TRUE,
- 'target_id' => [
- '#type' => 'hidden',
- '#id' => 'edit-content-link-target-id',
- '#attributes' => [
- 'id' => 'edit-content-link-target-id',
- ],
- '#default_value' => "",
- '#ajax' => [
- 'callback' => [
- 'Drupalentity_browserPluginFieldFieldWidgetEntityReferenceBrowserWidget',
- 'updateWidgetCallback',
- ],
- 'wrapper' => 'edit-content-link',
- 'event' => 'entity_browser_value_updated',
- ],
- ],
- 'entity_browser' => [
- '#type' => 'entity_browser',
- '#entity_browser' => 'image_browser_dropzonejs',
- '#cardinality' => 1,
- '#selection_mode' => 'selection_append',
- '#default_value' => [],
- '#custom_hidden_id' => 'edit-content-link-target-id',
- '#process' => [
- [
- 'Drupalentity_browserElementEntityBrowserElement','processEntityBrowser'
- ],
- ],
- ],
- 'current' => [
- '#theme_wrappers' => ['container'],
- '#attributes' => [
- 'class' => 'entities-list',
- ],
- 'items' => [],
- ],
- '#attached' => [
- 'library' => [
- 'entity_browser/entity_reference',
- ],
- ],
- ],
- ];
Add Comment
Please, Sign In to add comment