Copied to clipboard

Flag this post as spam?

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


  • Drew Garratt 44 posts 192 karma points
    Apr 22, 2013 @ 16:51
    Drew Garratt
    0

    Names with spaces FormFieldsets FormPages and Fields

    Hi Tim,

    Big fan of Contour and really enjoying support for code first it's making the whole process of creating the more complicated user flow forms in my project much easier.

    But there is one thing I can't seem to do and wondering if it's possible.

    When setting up my enum Formpages I'd really like to be able to add spaces to defined names, at least at there output.

    For instance the first step in the form I'm currently working on should be "Upload your CV" and the first form field should be named "Your CV". Currently I either have to add these fields without spaces or add in substitute characters that I then prune out in the Contour editor. But obviously this isn't the best idea.

    Is there a blindingly simple way around this I've missed?

    Umbraco 6.0.1 - Contour 3.0.9

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Apr 23, 2013 @ 09:05
    Tim Geyssens
    0

    Hey Drew in that case just use strings to set the page and fieldset captions instead of the enums

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Apr 23, 2013 @ 09:07
    Tim Geyssens
    0

    So you'll have

    [Field("Page caption","Field caption")]
            public string Name { get; set; }
  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Apr 23, 2013 @ 09:11
    Tim Geyssens
    100

    To keep it easy to update you can also store them in a private var

     private const string PageCaption = "Example";
    private const string FieldSetCaption = "Fieldset";
            [Field(PageCaption,FieldSetCaption)]
            public string Sample{ get; set; }
  • Drew Garratt 44 posts 192 karma points
    Apr 24, 2013 @ 15:01
    Drew Garratt
    0

    Hi Tim,

    Thanks for getting back to me. Once I had all my static private strings setup this was a doddle to name and define. Onto the slightly trickier task of creating a custom FieldType next.

    Thanks for the help ^-^

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Apr 24, 2013 @ 15:03
    Tim Geyssens
    0

    Great :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies