I'm trying to create a class which will register events within the Umbraco 7 backend. I'd like to create a plugin which allows you to hide certain doc type properties depending on the user group of the person logged in. (None of the existing plugins appear to be compatible with Umbraco 7)
I'd like to register an event when the edit content screen is loaded - how can I do this?
I've tried following the example in this page: http://24days.in/umbraco/2013/github-snippets-for-umbraco/ but I just receive an error in the Umbraco log (Error creating type Umbraco.Core.Models.PublishedContent.PublishedPropertyType+CompatConverter
System.MissingMethodException: No parameterless constructor defined for this object.)
So far I have:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Umbraco.Core;
using umbraco.presentation.masterpages;
using umbraco.uicontrols;
using Umbraco.Core.Logging;
namespace CustomHandlers
{
public class StartupHandlers : IApplicationEventHandler
{
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
umbracoPage.Load += umbracoPage_Load;
}
void umbracoPage_Load(object sender, EventArgs e)
{
LogHelper.Info(this.GetType(), "HELLO");
}
}
}
Registering Umbraco 7 Events
I'm trying to create a class which will register events within the Umbraco 7 backend. I'd like to create a plugin which allows you to hide certain doc type properties depending on the user group of the person logged in. (None of the existing plugins appear to be compatible with Umbraco 7)
I'd like to register an event when the edit content screen is loaded - how can I do this?
I've tried following the example in this page: http://24days.in/umbraco/2013/github-snippets-for-umbraco/ but I just receive an error in the Umbraco log (Error creating type Umbraco.Core.Models.PublishedContent.PublishedPropertyType+CompatConverter System.MissingMethodException: No parameterless constructor defined for this object.)
So far I have:
Can anyone point me in the right direction?
Cheers, Ian.
Hello,
The umbracoPage.Load is an old event which won't work with the new AngulasJS UI of v7. I don't know if it's currently possible in v7 what you're trying to do. This topic might help: http://our.umbraco.org/forum/developers/api-questions/47509-U7-Belle-Customize-the-behavior-of-the-content-view#comment170351
Jeroen
Thanks for the info Jeroen.
That's a real shame as I'm loving the v7 UI updates but realistically can't build new websites with it at the moment.
A lot will be fixed in v7.1. Hopefully this too.
Jeroen
is working on a reply...