Inhalte aufrufen

Profilbild

How to inject html in "productbox_add_info" widget zone from plugin?

plugin widget productbox_add_info

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
3 Antworten zu diesem Thema

#1 Sherif Ahmed

Sherif Ahmed

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 35 Beiträge

Geschrieben: 26 May 2019 - 02:53

Hi,

I'm trying to add html to the "productbox_add_info" wiget zone from my plugin but always getting this error:

No route in the route table matches the supplied values.

 

I added it as you added the machine name in "MachineNameFilter"  as below

 

_widgetProvider.Value.RegisterAction(

"productbox_add_info",
"MyAction",
"MyController",
new { area = "SmartStore.MyPlugin" });
 
and the controller inherits from PublicControllerBase as below 
 
public class MyControllerController : PublicControllerBase
{
       public ActionResult MyAction() { return View(); }
}

 

and the view I just typed a dummy string to be notted only so no need for it 

 

and the DependencyRegistrar, RouteProvider is the same as usual (like DevTools plugin)

 

but I always get the above error, maybe I miss something

 

Thanks in advance


Sherif Ahmed

Software Engineer

Egypt


#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 27 May 2019 - 09:22

Looks ok to me if MapRoute is correct. Could you please try to inherit from SmartController?


Marcus Gesing

Smartstore AG


#3 Sherif Ahmed

Sherif Ahmed

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 35 Beiträge

Geschrieben: 27 May 2019 - 21:44

Looks ok to me if MapRoute is correct. Could you please try to inherit from SmartController?

 

this is the routeprovider 

 

public partial class RouteProvider : IRouteProvider
{
    public void RegisterRoutes(RouteCollection routes)
    {
         routes.MapRoute("SmartStore.MyPlugin",
               "Plugins/MyPlugin/{controller}/{action}/{id}",
               new { controller = "AnotherController", action = "Index", id = UrlParameter.Optional },
               new[] { "SmartStore.MyPlugin.Controllers" }
         )
         .DataTokens["area"] = "SmartStore.MyPlugin";
     }
 
     public int Priority { get { return 0; } }
}
 
also tried to inherit from SmartController with no luck.
 
Regards,

Sherif Ahmed

Software Engineer

Egypt


#4 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 28 May 2019 - 17:52

public partial class RouteProvider : IRouteProvider
{
    public void RegisterRoutes(RouteCollection routes)
    {
         routes.MapRoute("SmartStore.MyPlugin",
               "Plugins/MyPlugin/{controller}/{action}/{id}",
               new { controller = "AnotherController", action = "Index", id = UrlParameter.Optional },
               new[] { "SmartStore.MyPlugin.Controllers" }
         )
         .DataTokens["area"] = "SmartStore.MyPlugin";
     }
 
     public int Priority { get { return 0; } }
}

"AnotherController" does not match "MyController". Please specify the correct name of your controller class.


Murat Cakir
SmartStore AG



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: plugin, widget, productbox_add_info