Jump to content
Sign in to follow this  
Guest

Настройка трехуровневого меню

Recommended Posts

Guest

Добрый день, дорогие форумчане! Есть меню вот такого типа:

post-701734-0-01592600-1444762757_thumb.png

Нужно сделать подкатегории, которые идут списком, третьим уровнем меню.
Вот код меню:

<div class="container">
<div class="row menu-line">
<div class="col-sm-12 col-md-7 col-md-push-3"><?php echo $search; ?></div>
<div class="col-sm-6 col-sm-push-6 col-md-2 col-md-push-3"><?php echo $cart; ?></div>
<div class="col-sm-6 col-sm-pull-6 col-md-3 col-md-pull-9">
<?php if ($categories) { ?>
<nav id="menu" class="btn-group btn-block">
<button type="button" class="btn btn-danger btn-block dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bars"></i>
<?php echo $text_category; ?>
</button>
<ul id="menu-list" class="dropdown-menu">
<?php foreach ($categories as $category) { ?>
<?php if ($category['children']) { ?>
<li>
<span class="toggle-child">
<i class="fa fa-plus plus"></i>
<i class="fa fa-minus minus"></i>
</span>
<a class="with-child" href="<?php echo $category['href']; ?>">
<i class="fa fa-angle-right arrow"></i>
<?php echo $category['name']; ?>
</a>
<?php if ($category['column'] < 2) { ?>
<?php $col_class = 'col-md-12'; ?>
<?php $box_class = 'box-col-1'; ?>
<?php $cols_count = 1; ?>
<?php } elseif ($category['column'] == 2) { ?>
<?php $col_class = 'col-md-6'; ?>
<?php $box_class = 'box-col-2'; ?>
<?php $cols_count = 2; ?>
<?php } else { ?>
<?php $col_class = 'col-md-4'; ?>
<?php $box_class = 'box-col-3'; ?>
<?php $cols_count = 3; ?>
<?php } ?>
<div class="child-box <?php echo $box_class; ?>">
<div class="row">
<?php $i = 0; ?>
<?php foreach ($category['children'] as $child) { ?>
<div class="<?php echo $col_class; ?>">
<div class="child-box-cell">
<h5>
<?php if($child['children2']) {?>
<span class="toggle-child2">
<i class="fa fa-plus plus"></i>
<i class="fa fa-minus minus"></i>
</span>
<?php } ?>
<a href="<?php echo $child['href']; ?>" class="<?php if($child['children2']) {echo 'with-child2';}?>"><span class="livel-down visible-xs-inline">↳</span><?php echo $child['name']; ?></a></h5>
<?php if($child['children2']) {?>
<ul class="child2-box">
<?php foreach ($child['children2'] as $child2) { ?>
<li><a href="<?php echo $child2['href']; ?>"><span class="livel-down">↳</span><?php echo $child2['name']; ?></a></li>
<?php } ?>
</ul>
<?php } ?>
</div>
</div>
<?php $i++; ?>
<?php if (($i == $cols_count) &($i != 1)) { ?>
<div class="clearfix visible-md visible-lg"></div>
<?php $i = 0; ?>
<?php } ?>
<?php } ?>
</div>
</div>
</li>
<?php } else { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
<?php } ?>
<?php } ?>
<?php if ($add_category_menu_toggle) {?>
<?php foreach ($add_category_menu as $item) { ?>
<li><a href="<?php echo $item['link'][$language_id]; ?>"><?php echo html_entity_decode($item['title'][$language_id], ENT_QUOTES, 'UTF-8'); ?></a></li>
<?php } ?>
<?php }?>
</ul>
</nav>
<div id="menuMask"></div>
<?php } ?>
</div>
</div>
</div>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.