I'm new to Craft and I'm trying to figure out how to place a form within an entry using a Solspace Freeform field. Specifically I need to pass the form handle into the render tag to place that form on a particular page.

{{ craft.freeform.form("formHandlefromfreeformfield").render() }}



Is this what you are looking for?

{{ entry.myFreeformfieldname.render() }}
  • Thanks! I believe you need to use the craft.freeform.form tag to display the form but my question was what is the syntax to pass the form handle to that tag?
    – fodney
    Jan 25 '18 at 14:44
  • You don't need that, entry.fieldHandle contains the form object which has the render method. The render tag grabs the form by handle and executes the render method so its basically the same but if you want to use it that way for whatever reason have a look at the documentation. entry.fieldHandle.handle contains the handle of the form Jan 25 '18 at 14:48
  • Ok, thanks. That one hasn't worked for me. Anyway, so what is the syntax for passing the formhandle to that tag ie how do I get the formhandle into{{ entry.myFreeformfieldname.render() }}
    – fodney
    Jan 25 '18 at 15:14
  • I stated it multiple times, it's all in the link I provided entry.fieldHandle.handle will return the form handle and you can render it with craft.freeform.form(entry.fieldHandle.handle).render() of course you need to insert a form in your cp and you have to replace the fieldHandle with the correct handle of your relationfield (I hope you did that) Anyway - if it does not work, could you dump your field? And tell if it is an instance of freeForm Jan 25 '18 at 15:19
  • Finally got it working. This is what I needed{{ craft.freeform.form(block.form.handle).render() }} Thank you for your help!
    – fodney
    Jan 25 '18 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.