Copied to clipboard

Flag this post as spam?

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


  • Jag Matharu 3 posts 24 karma points
    Mar 17, 2010 @ 10:59
    Jag Matharu
    1

    Contour - add text inbetween form fields that isn't a caption

    I am looking a using Contour for a form that is a standard .asp formpage at the moment. The current form has a paragraph of text within each fieldset that explains in detail what you need to enter for say the next group of 5 fields. Each field in the group may have caption text underneath too. Is there any way of doing with with Contour? At the moment I can only add field types through the UI?

    Thanks

  • Amir Khan 1287 posts 2744 karma points
    Apr 20, 2010 @ 04:16
    Amir Khan
    0

    Is there a way to do this?

  • Comment author was deleted

    Apr 20, 2010 @ 10:23

    Hi,

    You could simply make a new fieldtype a 'text' fieldtype.

    Check the Contour shared source project: http://our.umbraco.org/projects/umbraco-contour-shared-source

    That includes all the sourcecode for the default components in Contour (including field types), it should be pretty easy to make a 'text' type.

  • Pete 152 posts 176 karma points
    Jul 13, 2010 @ 18:20
    Pete
    0

    Did you end up getting this working? 

     

    I'm not sure at this point how to get it to render a textarea in the CMS for capturing the text while rendering plain text on the front-end control.

  • Pete 152 posts 176 karma points
    Jul 13, 2010 @ 18:39
    Pete
    0

    I'm getting it to output this now:

     

    It also won't save the text I enter. 

    < id="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_MasterContentPlaceHolder1_ctl00_RenderForm_6_rpFieldsets_ctl00_rpFields_ctl04_4e77bdea-6744-4d3b-a7c3-9a88150a733d">

    The code is:

     

    Label label;

            public List<Object> _value;

     

            public ParagraphText()

            {

                //Provider

                this.Id = new Guid("6C319FBA-8E98-11DF-AC4E-3A27DFD72085");

                this.Name = "ParagraphText";

                this.Description = "Renders a paragraph of text";

                //FieldType

                this.Icon = "";

                this.DataType = FieldDataType.LongString;

     

                //textbox = new TextBox();

                label = new Label();

                _value = new List<object>();

            }

     

            public override WebControl Editor

            {

                get

                {

                    //textbox.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine;

                    //textbox.CssClass = "text";

     

     

                    if (_value.Count > 0)

                        label.Text = _value[0].ToString();

     

                    return label;

                }

                set

                {

                    base.Editor = value;

                }

            }

     

            public override List<Object> Values

            {

                get

                {

                    if (label.Text != "")

                    {

                        _value.Clear();

                        _value.Add(label.Text);

                    }

     

                    return _value;

                }

                set

                {

                    _value = value;

                }

            }

     

     

            public override string RenderPreview()

            {

                return "<textarea class=\"textarea\"></textarea>";

            }

     

            public override string RenderPreviewWithPrevalues(List<object> prevalues)

            {

                return RenderPreview();

            }

     

            public override bool SupportsRegex

            {

                get { return false; }

            }

Please Sign in or register to post replies

Write your reply to:

Draft