2 votes

Contour Code First

THIS IS PART OF CONTOUR SINCE v3.0 (so no need for this addon)

Another result of freedom fridays at the Umbraco HQ, an addon for Umbraco Contour the official form builder that will allow you to create/update forms from code.

It’s heavily inspired by uSiteBuilder (they did all the hard work).

With this addon you will be able to design your Contour forms from visual studio

    public enum FormPages
    {
        Contact
    }
 
    public enum FormFieldsets
    {
        Details
    }
 
    [Form("Another Contact Form", MessageOnSubmit = "Thank you")]
    public class AnotherContactForm : FormBase
    {
        [Field(FormPages.Contact, FormFieldsets.Details,
           Mandatory = true)]
        public string Name { get; set; }
 
        [Field(FormPages.Contact, FormFieldsets.Details,
            Mandatory = true)]
        public string Email { get; set; }
 
        [Field(FormPages.Contact, FormFieldsets.Details,
           Mandatory = true,
           Type = typeof(Umbraco.Forms.Core.Providers.FieldTypes.Textarea))]
        public string Message { get; set; }
 
        public override void Submit()
        {
            
            umbraco.library.SendMail(
                Email,
                "[email protected]",
                "New Contact",
                string.Format("New message from {0} : {1}",Name,Message),
                false);
        }
    }

The download is an archive containing the assembly you'll need to get started for examples check out the sourcecode example project https://bitbucket.org/starfighter83/contour.addons.codefirst

 

Screenshots

No current release

Package owner

Tim Geyssens

Tim Geyssens

Tim has 15373 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Tim Geyssens
  • Created: 19/10/2012
  • Current version 1.0
  • License MIT
  • Downloads on Our: 536

External resources