Questions tagged [plugins]
Use it for Drupal 8 plugins; for plugins implemented from the Views module use views, ctools for Chaos tool suite plugins.
214
questions
3
votes
1
answer
861
views
How do I make an ajax callback in Field Plugin formElement() reload form?
I've created a custom field as a module Plugin and have the following code in the formElement() method of the field's Widget.php. The intention is to populate options in the second select element ...
2
votes
1
answer
1k
views
How does a module tell Drupal which mail plugin should be used?
How does a module tell Drupal which mail plugin should be used? The SMTP Authentication Support module uses the following code in the submission handler of its settings form.
$values = $form_state-&...
0
votes
1
answer
354
views
Is it possible to create an action with derivatives?
Is it possible to create an action in Drupal 8 and point it at a deriver class to generate them automatically?
For example with Custom Publishing Options I have a ConfigurableActionBase action that ...
1
vote
1
answer
315
views
How do I implement Entity Reference Behaviour Plugins?
Do Entity Reference behaviour plugins exist for Drupal 8? Please see:
https://www.drupal.org/node/1803064#comment-10717088
Are there any existing examples; documentation or code?
I would like to ...
0
votes
1
answer
43
views
How to display menu block but deny adding a new instance?
I have a menu which has a block provided by the system automatically.
This menu has links that come from a module which defines the menu(config).
This menu block can be seen(ie. the block is visible) ...
3
votes
1
answer
57
views
Field modification using PHP
I have a content type which contains field_state. The nodes of this content type store the two letter abbreviation for the state in each node using field_state. OH is Ohio, CA is California and so ...
5
votes
4
answers
2k
views
How do I get the current node from a Block module?
I'm looking to create a block that renders differently, depending on the content (metadata, really) of the node in which it is embedded.
The “Title” block is a good example of what I'm trying to do, ...
1
vote
1
answer
834
views
Add CKEditor widget (footnotes) from external addon
I want to add CKEditor footnotes addon to a Drupal 8 toolbar.
The plugin seems to load as I can add the button when configuring the input format and I see CKEDITOR.plugins.externals.footnotes is ...
2
votes
2
answers
2k
views
How to get block instance id in block plugin?
I have block plugin that renders lazy builder placeholder. In my lazy builder I need to get to the block's settings so I wanted to set the block id as lazy builder argument but it turned out the block ...
6
votes
1
answer
2k
views
Plugin versus Module
Drupal has many specific terms that can have different meanings depending on usage (e.g. view vs. a Drupal View). It looks like another in Drupal 8 is plugin & module. Generically, both seem to ...
2
votes
1
answer
979
views
Place custom Block, return Internal Server Error
I create a Block Plugin in a module,
it be showing the available blocks but when I try to place the block, it returns in the browser console the follow error:
AjaxError:
An AJAX HTTP error ...
2
votes
1
answer
63
views
Controlling node's content using field setting
In a module I am developing I wish to control display of a link in node's content depending on user's choice. I want to display this option to user(whether he wants to display the link on particular ...
0
votes
2
answers
360
views
validate a base field in a particular content type
Since title field is considered as base field in Drupal 8, I opted hook_entity_base_field_info_alter to add validation to it. But when I look at that hook.
hook_entity_base_field_info_alter(&$...
2
votes
1
answer
302
views
How to embed plugin configuration form elements into another form?
I have a form that lists entities and each of the entities has a checkbox.
The form also contains a list of actions(Action plugin) that can be performed on selected entities as a select list.
I would ...