The block system and API in Backdrop is very different from Drupal's. In Backdrop, as in Drupal, modules can define blocks in code (in fact some of the API at this level is the same, with...
Posted4 days 19 hours ago by Alejandro Cremaschi (argiepiano) on:
This was from examining line 2463- of the webform.module, where
// Attach necessary JavaScript and CSS.
$form['#attached'] = array(
'css' => array(backdrop_get_path('module', 'webform...
d'oh. Because of course it is reassigning. Don't mind me...
the correct syntax is
$form['#attached']['js'][] =
backdrop_get_path('module', 'mymodule') . '/mymodule.js';
Comments
Not perfect, but sometimes I use the specific
hook_block_view_system_main_alter
hook, fromhook_block_view_MODULE_DELTA_alter
.Hello @akarso!
The change log is here: https://api.backdropcms.org/change-records/new-layout-module-implements-...
Basically either use layouts (custom or via UI to place blocks) and if you need to alter code or data on page load use
hook_preprocess_page()
.