More in this section

Forums / Developing with Sitefinity / Embedding html form in blog post

Embedding html form in blog post

3 posts, 0 answered
  1. Stuart
    Stuart avatar
    33 posts
    01 Nov 2012
    29 Jul 2013
    Link to this post

    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.

  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    18 Jul 2012
    31 Jul 2013 in reply to Stuart
    Link to this post
    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: 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!
  3. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    31 May 2017
    01 Aug 2013
    Link to this post

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

    Stefani Tacheva
    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
3 posts, 0 answered