2022 Oktober

JTL Shop (5) – Print Linkgroups in Smarty

Nova has two simple snippets to print (custom) linkgroups, this snippet prints out list items without the list wrapper.

Link List with toggable submenus (like the regular sidebar menus)

{include file='snippets/linkgroup_recursive.tpl' linkgroupIdentifier='LINKGROUP_TEMPLATE_NAME' dropdownSupport=BOOL}

Link List with dropdown submenus (like the regular top-bar menu)

{include file='snippets/linkgroup_list.tpl' linkgroupIdentifier='LINKGROUP_TEMPLATE_NAME' dropdownSupport=BOOL}

To print out the links on your own, check out the code of those snippet templates.

    Extend a Module Library in a Module (like libraries-extend in Themes)

    Motorcycly with fully packed trailer

    In Drupal Themes its very easy to extend existing libraries using the themes .info (and .libraries) file. This ain’t possible in a Mobule .info file. So we need a hook to do this:

    /**
     * Implements hook_library_info_alter()
     * - Extend some module libraries we support or require for MY_MODULE
     */
    function MY_MODULE_library_info_alter(&$libraries, $extension) {
      if ($extension == 'views_bulk_operations' && isset($libraries['frontUi'])) {
        // Extend existing library views_bulk_operations/adminUi
        // Important! That a library is listed by this hook, doesn't mean the library is attached, it just means its registered.
        $libraries['frontUi']['dependencies'][] = 'MY_MODULE/MY_LIBRARY_NAME';
      }
    }