Embedding html form in blog post

Posted by Community Admin on 04-Aug-2018 19:40

Embedding html form in blog post

All Replies

Posted by Community Admin on 29-Jul-2013 00:00

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

Posted by Community Admin on 31-Jul-2013 00:00

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!

Posted by Community Admin on 01-Aug-2013 00:00

Hello,

Thank you Josh for sharing this solution. I hope that Stuart will find it useful.

Regards,
Stefani Tacheva
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed