Commit a98abdde authored by Chi Bui's avatar Chi Bui 👀

edit menu to 1 level

parent a410a535
This diff is collapsed.
This diff is collapsed.
......@@ -767,9 +767,13 @@
include $app_root . '/' . $site_path . '/settings.local.php';
}
$databases['default']['default'] = array (
'database' => 'invi_ptd',
'username' => 'invi_dev',
'password' => 'Invi@123456789a@A',
// 'database' => 'estore',
// 'username' => 'root',
// 'password' => 'root',
'database' => 'invi_estorequ2',
'username' => 'user',
'password' => '12345',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
......
{#
/**
* @file
* Default theme implementation to display a menu.
*
* Available variables:
* - classes: A list of classes to apply to the top level <ul> element.
* - dropdown_classes: A list of classes to apply to the dropdown <ul> element.
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link url, instance of \Drupal\Core\Url
* - localized_options: Menu link localized options.
*
* @ingroup templates
*
* Define a custom macro that will render all menu trees.
*/
#}
{% macro menu_links(items, attributes, menu_level, classes, dropdown_classes) %}
{% if items %}
{% set menu_classes = ['sidebar__menu' ~ menu_name | clean_class] %}
{% set submenu_classes = ['sidebar__menu' ~ menu_name|clean_class ~ '--submenu','sidebar__menu--submenu-' ~ (menu_level + 1),]%}
{% if menu_level == 0 %}
<ul {{ attributes.addClass( classes ) }}>
{% else %}
<ul{{ attributes.removeClass(menu_classes, 'sidebar__menu--submenu-' ~ (menu_level)).addClass(submenu_classes ,classes, "dropdown-menu") }}>
{% endif %}
{% for item in items %}
{% set item_classes = item.url.getOption('container_attributes').class | split(" ") %}
{%
set item_classes = [
item.is_expanded and item.below ? 'expanded dropdown',
item.in_active_trail ? 'active active-trail',
loop.first ? 'first',
loop.last ? 'last',
]
%}
<li{{ item.attributes.addClass(item_classes) }}>
{% set link_title = item.title %}
{% set link_attributes = item.link_attributes %}
{% if menu_level == 0 and item.is_expanded and item.below %}
{% set link_title %}{{ link_title }}
<i class="fa fa-chevron-right" aria-hidden="true"></i>{% endset %}
{% set link_attributes = link_attributes.addClass('dropdown-toggle').setAttribute('data-toggle', 'dropdown') %}
{% endif %}
{# Must use link() here so it triggers hook_link_alter(). #}
{{ link(link_title, item.url, link_attributes.addClass(item.in_active_trail ? 'active-trail')) }}
{% if item.below %}
{{ _self.menu_links(item.below, attributes.removeClass(classes), menu_level + 1, classes, dropdown_classes) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{#
Invoke the custom macro defined above. If classes were provided, use them.
This allows the template to be extended without having to also duplicate the
code above. @see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ _self.menu_links(items, attributes, 0, classes ?: ['menu', 'menu--' ~ menu_name|clean_class, 'nav'], dropdown_classes ?: ['dropdown-menu']) }}
......@@ -22,24 +22,27 @@ body {
/* invi custom */
header.navbar .category-menu ul.menu ul.dropdown-menu li:hover{
background: white ;
background: white;
margin-left: 0;
}
header.navbar .category-menu ul.menu ul.dropdown-menu li{
border: none ;
/* border: none; */
font-weight: 200 !important;
padding: 5px 0px;
}
.menu--category-menu .open .dropdown-menu { /* menu lv2 */
display: flex;
flex-direction: row;
justify-content: space-around;
flex-direction: column;
justify-content: flex-start;
top: 0;
left: 97%;
/* width: 100%; */
text-align: center;
/* width: 73%; */
/* text-align: center; */
background: white !important;
/* height: 169%; */
}
.menu--category-menu .open .dropdown-menu li {
width: 150px;
width: 100%;
}
.menu--category-menu .open .dropdown-menu li a{
font-weight: 600;
......
......@@ -59,8 +59,8 @@
}
// Custom menu
$(".dropdown-toggle").mouseover(function(){
// $(this).parent("li.expanded.dropdown").click();
$(this).parent("li.expanded.dropdown").addClass("open");
})
$(".dropdown-menu").mouseover(function(){
......@@ -70,7 +70,6 @@
$(this).parent("li.expanded.dropdown").removeClass("open");
})
$(".dropdown-toggle").mouseleave(function(){
// $(this).parent("li.expanded.dropdown").click();
$(this).parent("li.expanded.dropdown").removeClass("open");
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment