I'm currently evaluating N2 CMS for use for multiple websites.
We would only like to offer the 'drag' functionality to our clients, which means they can add parts to Zones on the page, fill them out, and drag them around. The "backend" functionality of the management zone will be reserved for the developers.
Therefore, I don't use the SlidingCurtain control to render. Right now, I've made a custom Admin Panel that appears when a user with the correct role is logged in. Normally, the Sliding Curtain adds a "?edit=drag" query string to your URL when you click the 'drag' functionality button, so I add this querystring automatically after logging in.
If I do this, I get a NullReferenceException to the following line: Html.DroppableZone("H1").Render();
As of this moment, there are no parts on this DroppableZone yet, and I suppose this is what is causing this problem. How do I get around this?
I have the following H1Controller:
namespace EmptyCMS.Controllers
{
[Controls(typeof(Models.H1))]
public class H1Controller : ContentController<Models.H1>
{
public override ActionResult Index()
{
return PartialView("H1", CurrentItem);
}
}
}
And the following partialview:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Models.H1>" %>
<h1><%= Model.Text %></h1>
And this is my model:
namespace EmptyCMS.Models
{
[PartDefinition("H1")]
[AllowedZones("H1")]
public class H1 : ContentItem
{
[EditableTextBox("Text", 100)]
public virtual string Text { get; set; }
}
}
Can anyone spot what I'm doing wrong? Thanks a lot for any help you can give me.