Add menu entries for extra pages served through plugin

4 years ago
Hi, I'm a newbie here... For one of my customers I'm developing a web shop based on Nop.
One of the requirements is to provide aftersales support for the products sold (e.g. registering serial numbers for warranty, some IoT functionality,...). There's thus a need to add menu-entries so the custom routes from the plugin can be triggered.

I was looking at implementing a Topic page with it's own Topic Template, this offers the possibility to add entries to sitemap, top menu, and in all 3 columns of the footer. I do not need the 'body' functionality (left empty), only a link to my plugin pages. As a system name of the Topic Page, I used EEPC_MyRadiators/EEPC_Manage, which is the page in my EEPC_MyRadiators plugin I want to call. Unfortunately the system does not like the '/' and strips it off before putting it in the UrlRecord database table. I changed it in the DB itself and all started working...
However each time I edit the Topic page, the entry is reset (new row created in dbo.UrlRecord without '/', old dbo.UrlRecord row invalidated by setting the IsActive to false).

I was wondering why the slash is removed as it would be a perfect way to implement a 'Topic link' as apposed to a 'Topic page'.

Am I overlooking something here?

Rik
4 years ago
Hi,
While you get things work by modifying the database, it's not a good way to implement the functionality of that sort.

What you should do instead is that you should implement the interface IWidgetPlugin in your plugin file and implement the method GetWidgetZones. In this method, return the widget zone 'account_navigation_before' or 'account_navigation_after' if you wish to show the links in customer navigation menu (i.e. Info, Orders etc.)
or 'footer' if you wish to show it in footer.

The create the view that displays those links with your routes. That way, it'd be easier and better to maintain.

Hope this helps.