Embedding html form in blog post
Hi,
I have written a server to take single question 'survey' responses from our blog and aggregate the responses in MongoDB. However, I cannot embed a simple html web form into the blog post because SItefinity only allows one form per page - that being the webform that it is built on.
In MVC, I was able to use the @using(Html.BeginFormSitefinity()) and it generates markup and javascript that allow the form in the MVC widget to function on the page. However, the blog posts don't have the benefit of that helper method.
Is there anyway to write a simple html form into a blog post? Ideally, I'd like it to be fairly easy and reproducible so that I can hand a set of syntax rules off to the blog writer.
Thanks,
Stuart
Because the blog post content is saved as straight text or html, there's not really any way to drop in any kind of form control to render the form...
probably the very EASIEST way to do this is to add the form to a blank Sitefinity page, then use an IFRAME to embed that page into the blog post content.
An alternative might be to override the template, using something similar to this post on shortcodes: www.sitefinity.com/.../supporting-shortcodes-in-sitefinity-content to display a form using code-behind, but this is probably going to be very tricky and more trouble than it's worth
Unless it's something you're doing on a regular basis, I would suggest the IFRAME is your best bet to do it quickly.
I hope this is helpful!
Hello,
Thank you Josh for sharing this solution. I hope that Stuart will find it useful.
Regards,
Stefani Tacheva
Telerik