0

Is it possible to create relationships in freeform pro similar to how you can create relationships between channels?

I have two channels, a freeform for each, and a need to relate the information from each using a third form. I know I can do a lot of this using channel forms but I really like some of the functionality that freeform gives me.

I guess a third option is to tie in the freeform into the channel as written in the freeform docs.

If anyone has any suggestions I would certainly welcome your input. Thank you.

6
  • "I have two channels, a freeform for each" => Can you elaborate? Do you mean you store channel data in a Freeform form? "and a need to relate the information from each using a third form" => Do you mean store data from the previous 2 Freeform forms into yet another (3rd) Freeform form?
    – Solspace
    Aug 7, 2014 at 3:03
  • Sure thing. I am storing the data for each channel in a Freeform form, so there are currently no channel entries for either channel,only Freeform entries. The first channel is called Theatres, and I'm using a Freeform form to allow theatre owners to add and edit theatres. I'm then displaying the freeform entries in a table so the owners can view/edit their theatres. The second channel is called Admin, and I'm using a Freeform form to allow Super Admins to add new movies/features. I'm displaying all features in a table for this channel as well.
    – hurjas
    Aug 7, 2014 at 5:00
  • If there are no Channel Entries, why are you calling these Freeform forms "Channels"? Sorry, but I'm confused.
    – Solspace
    Aug 7, 2014 at 5:05
  • The final piece I need to add is a Booking form (the 3rd form) that lists a single feature and the theatres of the logged in theatre owner. I need to place a field out next to each theatre that allows the owners to input the number of prints/screens they will have available for that particular feature. Then I'll send notifications upon submit. I'm just not sure if I can do what I need to with Freeform in this scenario. I hope the extra info helps and makes sense. I appreciate your time and feedback. Let me know if you need additional info. Thx
    – hurjas
    Aug 7, 2014 at 5:07
  • I apologize for the confusion. You are correct. Technically they're not channels and are really Freeform entries. I have channels set up if necessary. So I do apologize for the confusion.
    – hurjas
    Aug 7, 2014 at 5:09

1 Answer 1

0

I recommend reading the comments to the opening post for more details about the question. There are no "Channels" in this setup, only Freeform forms (forms were simply described as similar to "channels" in the opening post).

Summary

There are currently 2 Freeform forms:

  • Theatres: Contains theatre information
  • Admin: Contains other theatre and movie information

The Goal

A 3rd form is needed, called Booking, which contains data from the first 2 forms.

A Suggested Solution*

* As with most things EE, more than one solution is possible. This is only one possible strategy.

You can build this using {exp:freeform:form} and {exp:freeform:entries}. Let's say you have 3 fields in the Booking form set up to store data:

  • movie
  • theatre: the field will be populated with entries from the Theatres form for the currently logged in user
  • no_of_prints

You could build the form this way (this is just an example):

{exp:freeform:form form_name="booking" /* your other parameters here */}

    {!-- The movie --}
    {exp:freeform:entries form_name="admin" search:movie_name="Snowpiercer"}
        <input type="text" name="movie" value="{freeform:field:movie}" />
    {/exp:freeform:entries}

    {!-- The theatre --}
    <select name="theatre">
        <option>-- Select a theatre --</option>
        {exp:freeform:entries form_name="theatres" author_id="CURRENT_USER"}
        <option value="{freeform:field:theatre_name}">{freeform:field:theatre_name}</option>
        {/exp:freeform:entries}
    </select>

    {!-- The Number of Prints/Screens --}
    <input type="text" name="no_of_prints" placeholder="Eg. 50" />

    <input type="submit" />
{/exp:freeform:form}

If you have custom fields with the same name across Freeform forms, you might run into issues where tags such as {freeform:field:movie} get parsed as a field, since it's within {exp:freeform:form}, when you really wanted a value, since it's also within {exp:freeform:entries}. In that case, use embed templates to isolate the {exp:freeform:entries} tag code.

1
  • Great. I see what I was doing wrong now and this gives me a really good idea for next steps. Thank you for the additional info too. I will let you know how it goes. I really appreciate your time and assistance!
    – hurjas
    Aug 7, 2014 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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