Try our conversational search powered by Generative AI!

trying to create an mvc admin plugin

Vote:
 

Ok, here's what I am trying to do. 

I have a page with a listing of companies let's say.

The data itself is coming from the dynamic data store, but that's irrelevant at this stage,

I want the admins to be able to add new companies data. 

So I thought I'd create an admin plugin ( mvc ) to get this to work.

I have been unable to get this plugin to work, here's what I did so far:

I created a new controller called MyExamplePluginController - random name. This controller resides in the normal controllers folder.

The namespace for this class is XX.YY - let's say.

Then I decorated it with this :

[EPiServer.PlugIn.GuiPlugIn(
Area = EPiServer.PlugIn.PlugInArea.AdminMenu,
Url = "/modules/XX.YY/MyExamplePlugin/Index",
DisplayName = "Company Add Plugin"
)]

I then went and created the folder XX.YY in modules. In that folder I then placed an Index.cshtml view.

At this point if I login to the admin section of the cms I can see my plugin listed. When I click on the link though it throws a 404.

I cannot get this to work in any way shape or form so any ideas are more than welcome at this stage.

I tried to put the controller in the same folder with the view. Didn't help at all.

What am I missing ?

Also please don't point me at any allow resources, I've already been through all the articles and found that they didn't help.

#89422
Aug 15, 2014 15:40
Vote:
 

Have you tried to follow Pauls guide?
http://world.episerver.com/Blogs/Paul-Smith/Dates1/2011/8/Creating-EPiServer-AdminEdit-Plug-ins-using-MVC/

#89431
Aug 15, 2014 20:11
Vote:
 

What I'm usually doing for this kind of tasks is to add support for single file deployments - controllers, views, etc are bundled together into one .dll file as embedded resources and served by specially registered provider. You can try to sneak some cheats if interested in one of my plugins - http://tech-fellow.net/2013/10/17/overview-episerver-scheduled-jobs-interactively/

#89441
Aug 16, 2014 23:02
Vote:
 
#89445
Aug 18, 2014 6:57
Vote:
 

That is a great tool Valdis and a nice solution with one dll deployment!

#89446
Aug 18, 2014 6:57
Vote:
 

yes Henrik I did andI got the same thing as the guy who posted the last answer

#89462
Aug 18, 2014 10:03
Vote:
 

thank you Valdis I was trying to avoid having to create a separate dll for this, but if there is no other way I guess I'll have to

#89463
Aug 18, 2014 10:03
Vote:
 

It's not that you have to create a separate .dll file for the project. You code is packed in .dll file already anyway. Idea is that you dopn't need to deal with separate files for views, scripts, etc. Everything is embedded inside your main .dll file. It makes testing and debugging addon so much easier - you just drop new .dll file version in your target testing app and debug :) This is really an optional step to take not a prerequisite.

#89465
Aug 18, 2014 10:44
Vote:
 

Yeah that's exactly the issue. My code is indeed inside the main dll, the problem is that it cannot route the request properly. That's what I am struggling with it and I don't know enough about EPI server to make it work. That's why I am getting a 404 instead of seeing something. If I can make epi server route the request properly then the issue is solved. 

It's not meant to be an add-on, this is something very specific to a project and it won't get reused. This is why I left inside the main project, there's no need for it to be built outside of it.

#89466
Aug 18, 2014 10:49
Vote:
 

Do you register any custom routes by yourself?

#89472
Aug 18, 2014 12:21
Vote:
 

I'm trying to create my very first MVC based admin plugin for EPiServer 7.5+... Now how can I reuse the nice EPiServer GUI buttons in my code?

In the plugin, the administrator should be able to select a file (using the EPiServer file picker) and a location where s/he wants to create some global blocks.

Suggestions, anyone?

#118472
Mar 06, 2015 17:08
Vote:
 

You may achieve this by adding the Episerver system styles as partial view, Anders:

@using EPiServer.Framework.Web.Resources

@*
- Renders necessary Episerver system styles
----------------------------------------------------- *@

@Html.Raw(ClientResources.RenderResources("ShellCore"))
@Html.Raw(ClientResources.RenderResources("ShellWidgets"))
@Html.Raw(ClientResources.RenderResources("ShellCoreLightTheme"))
@Html.Raw(ClientResources.RenderResources("Navigation"))
@Html.Raw(ClientResources.RenderResources("DojoDashboardCompatability", new[] { ClientResourceType.Style }))
@Html.Raw(ClientResources.RenderResources("system"))

 

Then refer to this as partial view ( @Html.Partial("~/Views/Shared/yourname.cshtml") ). Then you may use the Episerver guidelines to your service:

http://ux.episerver.com/

#179756
Jun 20, 2017 21:22
Vote:
 

Here you can find a guide on how to do admin plugin with MVC

https://world.episerver.com/blogs/Henrik-Fransas/Dates/2016/11/extending-the-episerver-editor-interface/

#179763
Jun 21, 2017 8:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.