πŸ‡«πŸ‡·France @Eric MORAND

Account created on 25 October 2017, about 7 years ago
#

Recent comments

πŸ‡«πŸ‡·France Eric MORAND

Actually, there is a cleaner way - in the sense that it removes the wrapper from the rendering pipeline: remove it in the hook hook_element_info_alter.

The wrapper is added by the system module invokation of this hook. To be sure that it is removed by our custom module, we need to make sure that this hook is invoked in our module after the system module invokation. The simplest way is to set our module hook as the latest one invoked - but one who need more granular control could just put it after the system hook.

/**
 * Implements hook_module_implements_alter().
 */
function my_module_module_implements_alter(&$implementations, $hook) {
    $moduleIdentifier = 'my_module';
    
    if ($hook == 'element_info_alter') {
        $implementation = $implementations[$moduleIdentifier];
        unset($implementations[$moduleIdentifier]);
        $implementations[$moduleIdentifier] = $implementation;
    }
}

/**
 * Implements hook_element_info_alter().
 */
function my_module_element_info_alter(&$type) {
    unset($type['page']['#theme_wrappers']['off_canvas_page_wrapper']);
}
πŸ‡«πŸ‡·France Eric MORAND

It is explicitely written: 

> URL (must be hosted on Drupal.org, upload with β€œAdd a new file”)

Your solution is to do exactly the opposite:

* Hosted not on drupal.org
* Not uploaded using "Add a new file"

Production build 0.71.5 2024