Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian Black 54 posts 230 karma points
    Jan 17, 2014 @ 18:02
    Ian Black
    0

    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:

    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");
            }
    
        }
    }
    

    Can anyone point me in the right direction?

    Cheers, Ian.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 19, 2014 @ 11:06
    Jeroen Breuer
    0

    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

     

  • Ian Black 54 posts 230 karma points
    Jan 20, 2014 @ 09:48
    Ian Black
    0

    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.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 20, 2014 @ 12:09
    Jeroen Breuer
    0

    A lot will be fixed in v7.1. Hopefully this too.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft