Jump to content

Photo

layout page "_AdminRoot" could not be found

admin layout page cshtml

  • Please log in to reply
2 replies to this topic

#1 DrCopyPaste

DrCopyPaste

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 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 likes this

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3821 posts

Posted 14 June 2018 - 15:11

Please decorate your action method with the AdminThemed attribute.

  • Ahmed Alkhatib likes this

Marcus Gesing

Smartstore AG


#3 DrCopyPaste

DrCopyPaste

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 June 2018 - 16:04

Worked like a charm. Thank you!