Inhalte aufrufen

Profilbild

layout page "_AdminRoot" could not be found

admin layout page cshtml

2 Antworten zu diesem Thema

#1 DrCopyPaste

DrCopyPaste

    Newbie

  • Members
  • 2 Beiträge

Geschrieben: 14 June 2018 - 13:59

Hello,

 

I am trying to make my custom plugin code work with the new SmartStore version.

The plugin was originally developed for version 2.6.

 

In that plugin a custom administration menu was built that extends the backend administration of the SmartStore.

(PluginRoot\Menus\AdminMenu.cs (inheriting AdminMenuProvider))

 

So the link in the administration section itself works, but the required layout page cannot be loaded.

In the view behind said link I reference a layout page like this

Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";

(Same code in version 2.6 and version 3.1.5)

 

But I see that layout page then references another layout page, but without stating the file extension:

Layout = "_AdminRoot";

And that seems to be my problem, I do not understand what I have to do so that the view engine properly finds the referenced layout page, any hints? Or are there sample plugins that also provide such custom administration menus? I could not find any.

 

I see that this works out of the box if I create a new MVC-Project from scratch using .net core, but since SmartStore does not use .net core yet, there seems to be something else missing for me...

 

 

Any help is greatly appreciated.


  • GalenKa gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3317 Beiträge

Geschrieben: 14 June 2018 - 15:11

Please decorate your action method with the AdminThemed attribute.

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#3 DrCopyPaste

DrCopyPaste

    Newbie

  • Members
  • 2 Beiträge

Geschrieben: 14 June 2018 - 16:04

Worked like a charm. Thank you!





Auf dieses Thema antworten