0

So, I am trying to accomplish this design. design

My issue is trying to populate 2 separate menus because it seems as though I have to create two root categories(which I understand why that is stupid) or use two sub-categories.

I have looked at getHtml in vendor/magento/module-theme/Block/Html/Topmenu.php

public function getHtml($outermostClass = '', $childrenWrapClass = '', $limit = 0)
{
    $this->_eventManager->dispatch(
        'page_block_html_topmenu_gethtml_before',
        ['menu' => $this->getMenu(), 'block' => $this, 'request' => $this->getRequest()]
    );

    $this->getMenu()->setOutermostClass($outermostClass);
    $this->getMenu()->setChildrenWrapClass($childrenWrapClass);

    $html = $this->_getHtml($this->getMenu(), $childrenWrapClass, $limit);

    $transportObject = new \Magento\Framework\DataObject(['html' => $html]);
    $this->_eventManager->dispatch(
        'page_block_html_topmenu_gethtml_after',
        ['menu' => $this->getMenu(), 'transportObject' => $transportObject]
    );
    $html = $transportObject->getHtml();
    return $html;
}

but I am not sure how to go about expanding the block to pass in a separate category

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.