Okay
  Public Ticket #1366057
Megamenu, columns
Closed

Comments

  •  3
    khansen started the conversation

    When using the Megamenu to display categories and also using columns to display static content there is a bug that doesn't allow static content in a megamenu item with only 2 columns.

    If you chose 2 columns for a menu item and put content in the field "Right Content" under the tab "Static content" the menu item is wide enought to contain it – but nothing appears.

    If you choose 3 columns the content appears corectly.

    The reason can be found in the code of the menu module. This file to be exact:
    app/code/MGS/Mmegamenu/Block/Abstractmenu.php

    In line 438 an if/else checks the number of columns but the scenatio with two columns effectively excludes it to show the right content.

    A tempoary fix is to add the code that checks and displays right content along with the closing of the UL in line 458

    I am not sure what consequence the change has to menu items with more columns. 

    This code:

                    if ($columns > 1) {
    if($item->getRightContent()!='' && $item->getRightCol()!=0){
    $html.='<div class="right_content static-content col-md-'.$this->getColumnByCol($item->getColumns()) * $item->getRightCol().'">';
                            $html.= $this->_filterProvider->getBlockFilter()->filter($item->getRightContent());
                            $html.='</div>';
    }

                        if ($item->getBottomContent() != '') {
                            $html.='<div class="bottom_content static-content col-md-12">';
                            $html.= $this->_filterProvider->getBlockFilter()->filter($item->getBottomContent());
                            $html.='</div>';
                        }

                        $html.= '</div></div>';
                    } else {
                        $html.= '</ul>';
                    }

    Can be replaced with this

                    if ($columns > 1) {
    if($item->getRightContent()!='' && $item->getRightCol()!=0){
    $html.='<div class="right_content static-content col-md-'.$this->getColumnByCol($item->getColumns()) * $item->getRightCol().'">';
                            $html.= $this->_filterProvider->getBlockFilter()->filter($item->getRightContent());
                            $html.='</div>';
    }

                        if ($item->getBottomContent() != '') {
                            $html.='<div class="bottom_content static-content col-md-12">';
                            $html.= $this->_filterProvider->getBlockFilter()->filter($item->getBottomContent());
                            $html.='</div>';
                        }

                        $html.= '</div></div>';
                    } else {
    if($item->getRightContent()!='' && $item->getRightCol()!=0){
    $html.='<div class="right_content static-content col-md-'.$this->getColumnByCol($item->getColumns()) * $item->getRightCol().'">';
                            $html.= $this->_filterProvider->getBlockFilter()->filter($item->getRightContent());
                            $html.='</div>';
    }

                        $html.= '</ul>';
                    }

    Please make an updated module available.

  • [deleted] replied

    Hi,

    Please update this file to replace "Abstractmenu.php"

  •  3
    khansen replied

    Thanks. I can confirm that it works in my scenario.