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?
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
Is there a way to do this?
Comment author was deleted
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.
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.
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; }
}
is working on a reply...