Anybody got an example of how to insert a Contour form into a content page?
I've not yet been able to locate any examples of how the Contour forms are called in a content page. I've heard a few mentions of calling it from a template instead of from the content page - is this essential?
I know that I can Insert Macro > Insert Form from Contour, but when I do that directly into one of my pages, it shows up in the editor but not in preview or the front end. So I thought I'd look at the code that had been generated - however, I don't know what it's supposed to look like.
The code that was inserted by the macro looks like this:
<div class="umbMacroHolder" title="This is rendered content from macro" umbpageid="2061" umbversionid="84f79da2-dbab-4347-96ee-30519bf006d2" onresizestart="return false;" ismacro="true" umb_formguid="9b366fee-1c4f-4cf1-9455-f20b9bee090c" umb_macroalias="umbracoContour.RenderForm"><!-- startUmbMacro -->
<div class="contourField text firstname mandatory"><!-- Our label --> First Name
<div><!-- The data entry control --></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField text lastname mandatory alternating"><!-- Our label --> Last Name
<div><!-- The data entry control --></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField text phonenumber mandatory"><!-- Our label --> Phone Number
<div><!-- The data entry control --></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField text mobile alternating"><!-- Our label --> Mobile
<div><!-- The data entry control --></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField text email mandatory"><!-- Our label --> Email
<div><!-- The data entry control --></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField radiobuttonlist whichbestdescribesyoureligibilitytoworkinaustralia mandatory alternating"><!-- Our label --> Which best describes your eligibility to work in Australia?
<div><!-- The data entry control --> <span class="radiobuttonlist">Citizen/Permanent Resident<br />Holder of a working visa<br />Require sponsorship<br />Other</span></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourField pleaseattachyourcoverletter mandatory"><!-- Our label --> Please attach your cover letter
<div><!-- The data entry control --> <span></span></div>
<div><!-- The data entry control --> <span></span></div>
<!-- Our Tooltip --> <!-- Validation --></div>
<div class="contourNavigation"></div>
</div>
<!-- endUmbMacro --></div>
Note: I'm a novice! I'm teaching myself as I go. So it may be obvious to others. But if I could see a working example that would be great. So far I can't find any documentation that outlines it, and every time somebody talks about it on the forums they refer to an approach without explicitly showing it on the post! :-)
I think it's something to do with needing some <form> tag, runat="server", that sort of thing... but I can't find the correct syntax anywhere.
Evan, you've made the comment "in your template"... can I just clarify, it's imperative that it's placed in the template? I've been trying to place it directly into the content page, but this apparently doesn't work/isn't possible?
Hi Phillip, This should work no worries, as I have Contour working in the same way.
I think there were some issues in earlier version with inserting a Contour form via the RichText editor. I would upgrade your Contour version to the latest nightly build:
Haha no worries. Another thing to try if that doesn't work is to check that you are not nesting forms or have more than one server form (<form runat="server">) in the template.
Anybody got an example of how to insert a Contour form into a content page?
I've not yet been able to locate any examples of how the Contour forms are called in a content page. I've heard a few mentions of calling it from a template instead of from the content page - is this essential?
I know that I can Insert Macro > Insert Form from Contour, but when I do that directly into one of my pages, it shows up in the editor but not in preview or the front end. So I thought I'd look at the code that had been generated - however, I don't know what it's supposed to look like.
The code that was inserted by the macro looks like this:
Note: I'm a novice! I'm teaching myself as I go. So it may be obvious to others. But if I could see a working example that would be great. So far I can't find any documentation that outlines it, and every time somebody talks about it on the forums they refer to an approach without explicitly showing it on the post! :-)
I think it's something to do with needing some <form> tag, runat="server", that sort of thing... but I can't find the correct syntax anywhere.
Thanks in advance!
Hi Philip
For the form to display and function you will need it to be contained within <form ranat="server"></form> tags.
For Example, in your template:
<form id="myForm" ranat="server">
<< insert contour form using macro >>
</form>
Hope this helps you.
Cheers
Evan
Hey Evan,
Just a quick note it's actually runat="server"
Evan, you've made the comment "in your template"... can I just clarify, it's imperative that it's placed in the template? I've been trying to place it directly into the content page, but this apparently doesn't work/isn't possible?
Hi Phillip,
This should work no worries, as I have Contour working in the same way.
I think there were some issues in earlier version with inserting a Contour form via the RichText editor.
I would upgrade your Contour version to the latest nightly build:
http://nightly.umbraco.org/Umbraco%20Contour/1.0.8/
Do a backup, and then use the update zip to update your contour version.
Hope this help :)
Cheers,
Neil
Thanks Neil! Running around like a chicken without a head right now, so will try to look at that over the weekend and see if it fixes it...
Cheers!
Haha no worries.
Another thing to try if that doesn't work is to check that you are not nesting forms or have more than one server form (<form runat="server">) in the template.
Cheers,
Neil
Looks like you've got this sorted, sorry about the typo...
is working on a reply...