SnowdogApps / magento2-menu

Provides powerful menu editor to replace category based menus in Magento 2
MIT License
296 stars 106 forks source link

submenu template name issue #321

Closed sd2894 closed 1 month ago

sd2894 commented 5 months ago

Hi,

I tried to add a custom sub-menu template in backend its shows like below image, how can i resolved it

image

app\code\Snowdog\Menu\Block\Menu.php

'Snowdog_Menu::' . $this->getMenu()->getIdentifier() . "/menu/custom/sub_menu/{$submenuTemplate}.phtml"

In Log its show like

Snowdog_Menu::hyva-topmenu-desktop/menu/custom/sub_menu/D:/xampp/htdocs/m245/app/code/Snowdog/Menu/view/frontend/templates/hyva-topmenu-desktop/menu/custom/sub_menu/test-sub.phtml

I resolved it temporary

app\code\Snowdog\Menu\Model\TemplateResolver.php

Replace below line

$fileName = str_replace([$themeDir, '.' . $extension], '', $file);

with

$fileName = pathinfo($file, PATHINFO_FILENAME);

image

andrzejborkowski commented 5 months ago

hi @sd2894,

Thank you for reporting the issue. I've created an internal ticket, DEV-105672, and our development team will review it soon. In the meantime, you are welcome to contribute. Feel free to create a PR with your changes, and after a code review, we can merge it into develop branch for a subsequent release. This approach may expedite the process compared to having our team check and implement the changes.

Regards, Andrzej

andrzejborkowski commented 1 month ago

This has been released already in 2.27.0 menu module version https://github.com/SnowdogApps/magento2-menu/blob/2.27.0/CHANGELOG.md