How to add custom mvc pages in to admin panel

59 views
Skip to first unread message

debabrata...@gmail.com

unread,
Jan 13, 2019, 7:15:14 AM1/13/19
to KalikoCMS Developer Forum
Hi,

I wanted to add custom pages to the admin panel. A new menu item would be added to the admin panel and on click of that, it would open the respective view. I need it to manage the application for custom user-specific data.

Is that possible If yes please suggest me?

Fredrik Schultz

unread,
Jan 13, 2019, 3:50:40 PM1/13/19
to KalikoCMS Developer Forum
Yes, that's possible to do by implementing IDashboardArea and register it at startup:

(Path is the property in which you place the URL to your page, either relative (which will refer to /admin/) or absolute).

As an example this is the registration for the user manager that comes with the ASP.NET Identity implementation:

Hope that helps!

debabrata...@gmail.com

unread,
Jan 14, 2019, 11:50:47 AM1/14/19
to KalikoCMS Developer Forum
Thanks I will try it out. However, I also found that Session is getting NULL under Index Action method.

public override ActionResult Index(CmsModel currentPage)
{
// Here Session object is always null.
Session[""] =
}

I think it's not initialized. I tried adding the module under web.config but didn't work.

Fredrik Schultz

unread,
Jan 23, 2019, 5:13:19 PM1/23/19
to KalikoCMS Developer Forum
I've looked into this and it seems there might be a module running a couple of event handlers too soon in the MVC pipeline.

Added it as an issue over at GitHub; https://github.com/KalikoCMS/KalikoCMS.Core/issues/154

Thanks for reporting the problem!

debabrata...@gmail.com

unread,
Jan 24, 2019, 10:16:31 PM1/24/19
to KalikoCMS Developer Forum
Ok Sure thanks

Fredrik Schultz

unread,
May 19, 2019, 10:39:25 AM5/19/19
to KalikoCMS Developer Forum
Pre-release packages (version 1.2.5-beta1) that address this issue are now available at https://www.nuget.org/packages?q=kalikocms

To enable support for session state when using the above version (1.2.5-beta1) of the MVC provider; add enableSessions="true" to the <siteSettings />-element of your web.config 

(For MVC projects not using session state this attribute should be set to false or omitted in order to get slightly better performance)

Jonathan Bourassa

unread,
Jan 30, 2021, 11:25:01 PM1/30/21
to KalikoCMS Developer Forum
Hello,

I am trying to do the Exact same ting here. I successfully registered the Area in The Admin and it shows up however when I click the Link I get a 404 not found. Tried Placing my Controller Both Inside the ./Admin/Controllers Folder and Plain ./Controllers Folder and not kicking in even tried using the [RoutePrefix("Admin")] DataAnnotation on the Controller.

Can someone explain me what I am missing here?

thank,

Jonathan Bourassa

unread,
Jan 30, 2021, 11:46:03 PM1/30/21
to KalikoCMS Developer Forum
Just a follow up to My Question, I tried With WebForms .Admin/[MyAreaName]/Default.aspx and this one worked fine without issues.

Jonathan Bourassa

unread,
Jan 31, 2021, 12:47:07 AM1/31/21
to KalikoCMS Developer Forum
OK I managed to get it working By Making a Controller Named AdminController and Removing the Index View from it to avoid Conflict with the default.aspx of the actual admin interface. However I am feeling like this is not Best Practice. I am right?

Fredrik Schultz

unread,
Feb 2, 2021, 3:40:29 PM2/2/21
to KalikoCMS Developer Forum
Hi Jonathan,
You should definitely be able to use [Route] and/or [RoutePrefix] attributes in your controller, even if it locates the URL to being under an "admin" path. 
Just to make sure that you've registered:
routes.MapMvcAttributeRoutes();
..in your route configuration?


Reply all
Reply to author
Forward
0 new messages