Inhalte aufrufen

Profilbild

How to add new item menu into item menu created.


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

#1 Xuan Nguyen

Xuan Nguyen

    Newbie

  • Members
  • Punkt
  • 9 Beiträge

Geschrieben: 08 February 2017 - 05:34

Dear All.

I created a item menu by use AdminMenu.cs, now i want add a item menu (child menu) into item menu i created (parent menu). So how do i do? Thanks you.



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 08 February 2017 - 11:11

Please see this commit.


  • Xuan Nguyen gefällt das

Marcus Gesing

Smartstore AG


#3 Xuan Nguyen

Xuan Nguyen

    Newbie

  • Members
  • Punkt
  • 9 Beiträge

Geschrieben: 09 February 2017 - 03:59

Please see this commit.

Thanks you very much.



#4 Xuan Nguyen

Xuan Nguyen

    Newbie

  • Members
  • Punkt
  • 9 Beiträge

Geschrieben: 17 February 2017 - 06:05

Please see this commit.

 Hi Admin. I add other new controller. I register router in Router Provider.cs

routes.MapRoute("SmartStore.GarageDashboard",
                 "Plugins/SmartStore.GaragePlugins/{controller}/{action}",
                 new { controller = "Garage", action = "Dashboard" },
                 new[] { "SmartStore.Garage.Controllers" }
            )
            .DataTokens["area"] = "SmartStore.Garage";

In AdminMenu.cs i use

 var childmenuItem1 = new MenuItem().ToBuilder()
               .Text("Dashboard")
               .ResKey("Plugins.FriendlyName.Garage")
               .Action("Dashboard","GaragePlugins")
               .ToItem();

But while run, it not found my View (Dashboard.cshtml) in path ~\Presentation\SmartStore.Web\Plugins\SmartStore.Garage\Views\GaragePlugins\Dashboard.cshtml

 

It show error:

 

The view 'Dashboard' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Plugins/Admin/Views/GaragePlugins/Dashboard.cshtml
~/Plugins/Admin/Views/Shared/Dashboard.cshtml
~/Themes/Alpha/Views/GaragePlugins/Dashboard.cshtml
~/Views/GaragePlugins/Dashboard.cshtml
~/Themes/Alpha/Views/Shared/Dashboard.cshtml
~/Views/Shared/Dashboard.cshtml

 

 

 Please help me. Thanks!



#5 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 17 February 2017 - 11:02

Please try 
.Action("Dashboard","GaragePlugins", new { area = "SmartStore.Garage" })

  • Xuan Nguyen gefällt das

Marcus Gesing

Smartstore AG


#6 Xuan Nguyen

Xuan Nguyen

    Newbie

  • Members
  • Punkt
  • 9 Beiträge

Geschrieben: 17 February 2017 - 17:16

 

Please try 
.Action("Dashboard","GaragePlugins", new { area = "SmartStore.Garage" })

 

It not working. Still not found the View. :(



#7 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 17 February 2017 - 19:47

What is the name of the controller? Properties of the view should be set to:

- Build Action: Content
- Copy to Output Directory: Copy if newer

  • Xuan Nguyen gefällt das

Marcus Gesing

Smartstore AG


#8 Xuan Nguyen

Xuan Nguyen

    Newbie

  • Members
  • Punkt
  • 9 Beiträge

Geschrieben: 17 February 2017 - 21:19

Oh i'm so sorry. i rebuild solution but i forget clear cache in my browser so it still has error. Now i can run it. Thanks for your enthusiastic help.