Drupal Bootstrap - 35 - BONUS: Disable Dropdown Support For Sidebar Menu
In this tutorial we are going to add a menu to the left sidebar without the dropdown function which Bootstrap theme has overridden for all menus. To do this, we will install the Menu block module, override and restore the original theme_menu_link() function for Menu Block module.
Playlist: https://goo.gl/yiadTa
Module to install:
https://www.drupal.org/project/menu_block
Menu Block Documentation:
https://www.drupal.org/node/1934824
Theme functions to be overridden:
- [theme]_menu_link__menu_block()
STEPS (Drupal 7):
-----------------------------
Step 1: Install and enable the Menu Block module
Step 2: Add a menu block to the primary region
Step 3: Copy original theme_menu_link() function from includes\menu.inc file and paste it to the template.php file located at your sub theme folder. e.g sites\all\themes\bootstrap_subtheme\template.php
Step 4: Update the function name with your sub theme name and apply to menu block. e.g.
bootstrap_subtheme_menu_link__menu_block(). For good practice, you can add a comment to the function.
Step 5: Flush all caches
Debug:
1. Make sure you replace the [theme] name with your sub theme name correctly. Earlier we created a sub theme called "bootstrap subtheme" and hence the function name should be bootstrap_subtheme_menu_link__menu_block()
2. Make sure you flush all caches
``````````````````````````````````````````````````````````````````````
STEPS (For DRUPAL 8):
``````````````````````````````````````````````````````````````````````
- Install and enable the Menu Block module
- Go to Block layout (Structure -} Block Layout), place a "Main navigation" block under "Primary" region
- Under "HTML AND STYLE OPTIONS" - "Theme hook suggestion", replace "main" with "menu_block" (though you can rename any name you like) and save blocks
- Go to \core\modules\system\templates\menu.html.twig and copy this file.
- Go to your sub theme and paste the file inside \templates folder
e.g themes\your_theme_name\templates\menu.html.twig.
- rename this twig file "menu" to "menu--menu_block" (Take note of the two Dashes and Underscore).
e.g themes\your_theme_name\templates\menu--menu_block.html.twig
- Flush caches and done!
Note:
-Basically what happen here is you create a new theme hook suggestion and override the menu.html.twig for menu block you created.
-You can reuse the same theme hook suggestion - "menu_block" as many as you like for other menu blocks you created. They will all pick up from the same "menu--menu_block.html.twig"
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Drupal Bootstrap - 35 - BONUS: Disable Dropdown Support For Sidebar Menu», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.