cancel
Showing results for 
Search instead for 
Did you mean: 

Navbar expand button not working

SOLVED

Navbar expand button not working

Hello all,

I have a problem with my site that I'm developing. I have bought a template, and unfortunately, the vertical navbar is not expanding. I have more than the categories displayed in the navbar, but the +Category button is not working, and I can see that chrome says void(0); at the bottom of the page. I tried contacting the template developer, but no luck, and I have no idea how to diagnose this issue. Any suggestions?

Thank you.

In case you wanted to visit the website you can check it out here.

 

Here is the code of the for the main page do you guys see anything wrong with it?

 

<?php

?>
<?php
/**
 * Top menu for store
 *
 * @see \Rokanthemes\VerticalMenu\Block\Verticalmenu
 */
?>
<?php
    $_helper = $this->helper('Rokanthemes\VerticalMenu\Helper\Data');
    $_config = $_helper->getConfig('verticalmenu');
    $columnsLimit = 0;
    if($_config['general']['enable']) {
?>
<?php $_menu = $block->getVerticalMenuHtml(); ?>

<nav class="navigation verticalmenu side-verticalmenu">
	<h2 class="title-category-dropdown"><span><?php echo __('Categorias'); ?></span></h2>
    <ul class="togge-menu list-category-dropdown" style="display:none;">
        <?php echo $_menu; ?>
        <li class="expand-category-link">
        	<a href="javascript&colon;void(0);"><?php echo __('Categorias') ?></a>
        </li>
        		<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('vertical_background_images')->toHtml();?>
	</ul>

</nav>

<script type="text/javascript">
    require([
        'jquery',
        'rokanthemes/verticalmenu'
    ], function ($) {
        $(".verticalmenu").VerticalMenu();
		$('.cms-index-index .navigation.verticalmenu .togge-menu').hide();
		$('.title-category-dropdown').click(function(event){
			$('.navigation.verticalmenu .togge-menu').slideToggle('slow');
			$(this).toggleClass('active');
		});
		$( document ).ready(function() {
			var lenghtLi = $('.cms-index-index .navigation.verticalmenu .ui-menu-item.level0').length;
			var limitItemShow = <?php echo $block->getConfig('limit_show'); ?>;
			if(lenghtLi > limitItemShow)
			{
				$('.navigation.verticalmenu .ui-menu-item.level0').each(function( index ) {
					if(index >= (limitItemShow - 1))
					{
						$(this).addClass('orther-link');
						$(this).hide();
					}
				});
				$('.navigation.verticalmenu .expand-category-link').show();
				$('.navigation.verticalmenu .expand-category-link').on( "click", function() {
					$(this).toggleClass('expanding');
					$('.navigation.verticalmenu .ui-menu-item.level0.orther-link').slideToggle('slow');
				});
			}
		});
    });
</script>
<?php
    }
?>
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Navbar expand button not working

Hi @sahandsigm749e 

As within code, there are some configuration available for set limit of top nav categories.

var limitItemShow = <?php echo $block->getConfig('limit_show'); ?>;

Please check with theme configuration first and update according to your requirement. 
You can also update configuration value direct from table "core_config_data" as well.

It may help you to resolve issue.
If issue resolve, please click on 'Kudos' & Accept as Solution!


Problem solved? Click Accept as Solution!

View solution in original post

1 REPLY 1

Re: Navbar expand button not working

Hi @sahandsigm749e 

As within code, there are some configuration available for set limit of top nav categories.

var limitItemShow = <?php echo $block->getConfig('limit_show'); ?>;

Please check with theme configuration first and update according to your requirement. 
You can also update configuration value direct from table "core_config_data" as well.

It may help you to resolve issue.
If issue resolve, please click on 'Kudos' & Accept as Solution!


Problem solved? Click Accept as Solution!