See https://www.drupal.org/project/drupal/issues/3089751 & https://www.drupal.org/forum/support/theme-development/2018-12-08/prevent-form-actions-from-appearing-in-a-modal-dialog
In mytheme.libraries.yml
dialog.ajax:
js:
This pre-commit hook is designed to be used for Drupal 7 and 8 sites.
Download the pre-commit file. Save it as .git/hook/pre-commit in your git repo. You need to ensure that the file is executable.
If you want this to be added to all new projects automatically, add it to your git init templates.
To install and PHP CodeSniffer for Drupal, please read the official documentation.
To see this working checking out this short YouTube video.
// Get element offset from top of page | |
function getOffset(el) { | |
el = el.getBoundingClientRect(); | |
return { | |
left: el.left + window.scrollX, | |
top: el.top + window.scrollY | |
}; | |
}; |
This will enable an additional view mode for use on the specified entity type(s). Many examples will show the custom settings
here being set to TRUE. If TRUE is used then that view mode is added to all entities of the specified type regardless of if it should be on the bundle or not.
/**
* Implements hook_entity_info_alter().
*/
function HOOK_entity_info_alter(&$entity_info) {
This will enable an additional view mode for use on the specified entity type(s). Many examples will show the custom settings
here being set to TRUE. If TRUE is used then that view mode is added to all entities of the specified type regardless of if it should be on the bundle or not.
/**
* Implements hook_entity_info_alter().
*/
function HOOK_entity_info_alter(&$entity_info) {