ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using Freeform in Channel Entries

April 27, 2011 10:35am

Subscribe [2]
  • #1 / Apr 27, 2011 10:35am

    maxlind

    4 posts

    Maybe I’m completely looking at this wrong, but I can’t seem to get Freeform to work within a Channel Entry. I’ve got a template for a contact page, from which there will be multiple entries for various contact forms (general, questions/comments, business, etc). When I throw the Freeform code in the channel entry, the code itself gets displayed in the page within “quotes”. What am I doing wrong?

    Take a look, but keep in mind…Work-in-progress!: http://drinkithere.com/contact

    Thanks in advance!

  • #2 / Apr 27, 2011 7:20pm

    John St-Amand

    865 posts

    Try using an embed to insert the form rather than putting it in-line inside the entries tag.  I don’t think you can use the freeform tag pair inside an entries tag pair without doing it that way.  Then the contact form would render first, separately from the entries tags.

  • #3 / Apr 27, 2011 7:21pm

    John St-Amand

    865 posts

    Either that, or just put the contact form outside the entries tag pair.

  • #4 / Apr 27, 2011 7:23pm

    John St-Amand

    865 posts

    Another great resource is this article: http://loweblog.com/freelance/article/user-generated-forms-in-ee/ - it guides you through setting up forms in a way that then becomes editable as entries - easier than inserting raw freeform code into an entry.

  • #5 / Apr 28, 2011 1:15am

    Rob Allen

    3118 posts

    Whay you could do on the same template is call the channel entry twice - once for your main page content, and second to populate any form fields…eg:

    {exp:channel:entries channel="my_channel"}
    {title}
    Stuff…
    {/exp:channel:entries}
    
    {exp:freeform…...}
    
      {exp:channel:entries channel="my_channel"}
      <input type="hidden" id="subject" name="subject" value="{my_custom_field}" />
      {/exp:channel:entries}
    
    {/exp:freeform}
  • #6 / Apr 28, 2011 6:57pm

    maxlind

    4 posts

    Thanks guys, your help is much appreciated!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases