Default values for the properties of you document types

Code for applying default values to Umbraco document types:

The code:

public class Default:ApplicationBase 
    {

        public Default()
        {
            Document.New += new Document.NewEventHandler(NewGallary_New);
        }

        void NewGallary_New(Document sender, umbraco.cms.businesslogic.NewEventArgs e)
        {
            if (sender.ContentType.Alias.Equals("NewGallary", StringComparison.CurrentCultureIgnoreCase))
            {
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "fotoHeight", "200" );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "fotoWidth", "200");
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "fotoWidthLightBox", "500");
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "useImageGen", true );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "repeatColums", "2" );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "repeatdirection", "horizontal");
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "repeatlayout", "flow" );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "photogallaryCSS", "photogallaryCSS" );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "aantalPerPagina", "6" );
                GallaryDLMediaFunctions.SetGenericPropertyValue(sender, "repeatdirection", "horizontal");
                sender.Save();
                sender.Publish(new User("admin"));

            }

        }
    }

{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!