Copied to clipboard

Flag this post as spam?

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


  • Josh Reid 182 posts 258 karma points
    Mar 30, 2013 @ 21:37
    Josh Reid
    0

    Member Login FieldType (Addons.MemberTools) DefaultValue

    Hi Tim

    Do you know if there is any way to enable/disable DefaultValue for a custom FieldType?

    I'm building a Member profile management based on your codefirst approach using an adaption of the MemberLogin FieldType, but the problem is it has no DefaultValue setting available (it's not even showing in the contour Admin editor > Additional Settings).

    -- Snippet from Codefirst:

            [Field("Profile", FormFieldsets.Details,
                Type = typeof(Contour.Addons.MemberTools.Providers.FieldTypes.MemberLogin),
                Mandatory = true,
                Regex = @"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$",
                DefaultValue = "{member.email}")]
            public string Email { get; set; }

    Sidenote: DefaultValue works if I comment the Type line so is a default Textbox Type (but need the MemberLogin functionality).

    Any thoughts on how to enable the DefaultValue on this FieldType?

    Thanks
    Josh

  • Comment author was deleted

    Apr 03, 2013 @ 13:04

    Hmm the Contour.Addons.MemberTools.Providers.FieldTypes.MemberLogin will probably need an update then, it must be missing the default value setting

  • Josh Reid 182 posts 258 karma points
    Apr 04, 2013 @ 00:10
    Josh Reid
    0

    I have the Fieldtype code here but can't see anywhere how to enable/disbale the Default Value setting.

    Assume it may be similar to adding the SupportRegex?

    Could you provide a snippet or the correct setting variable, etc?

  • Comment author was deleted

    Apr 04, 2013 @ 09:33

    Nope it's like you would add a custom setting

     [Attributes.Setting("DefaultValue", description = "Enter a default value", control = "Umbraco.Forms.Core.FieldSetting.TextField")]        public string DefaultValue { get; set; }
Please Sign in or register to post replies

Write your reply to:

Draft