Toolset allows you to create forms to connect posts that form a many-to-many relationship.

Before we discuss how to build these forms, we must first understand how forms fit into the site’s workflow. The following several cases must be covered:

  • Forms for connecting any two items in a relationship.
  • Forms for connecting between one given item and another item that the user must select.
  • Forms for editing existing connections between items in a relationship.

Already confused? Let us look at a practical example to understand these cases better and how to setup the forms for them.

Our example: songs and albums

Let us say we are creating a site that lists popular songs and the albums that contain them.  A song may appear on many albums and an album may have many songs. Therefore, there is a many-to-many relationship between albums and songs.

The following table lists the kinds of forms we can create, how they look, and what we must do to build them.

 

What the form doesHow it looks on the front-endWhat must be set up
Add any song to any album1. Create a new Relationship Form and follow the wizard to select its settings and content.

2. Create a page where users can add any song to any album.

3. Edit the new page and include the newly created Relationship Form.

Add a song to a specific album1. Create a template for displaying single -Album pages.

2. Create a new Relationship Form and follow the wizard to select its settings and content.

3. Create a template that will display only the newly created Relationship Form. This template should not be assigned to any content.

4. Edit the template created for displaying single -Album pages and insert the link to the newly created Relationship Form.

5. In the form-insertion wizard, select the option to “Add a Song to a given Album” and select “Link to a template that contains the form.”

Edit the location of a song on an album1. Create a template to use as an editing-mode” for the relationship. Do not assign it to any content.

2. Create a new Relationship Form and follow the wizard to select its settings and content.

3. Edit the template created in the first step and insert the form into it.

4. Edit a View that lists the songs and insert the Relationship Form you created.

5. In the form-insertion wizard, select the option to “Edit an existing Track on an Album” and select the newly created “editing-mode” template.

 

Now, let us review how to create a Relationship Form.

Creating Forms Relationship Forms

Read documentation for version with:

Using Layouts

  1. To create a form, insert a Forms Relationship Form cell into your layout.

  1. Click the Create Cell button and a dialog will appear, allowing you to set up your Relationship Form. In the Settings section, select the relationship and page to load after a user submits the form.

  1. The Form editor section displays all the fields related to a relationship. We can drag-and-drop fields to reorder them or click the “trash can” icon to delete specific fields. Fields marked with a “padlock” icon cannot be disabled. Clicking the button on the right side of each field name reveals additional options for that field (i.e., those that allow us to choose how users will select relationship options). After selecting the desired options, click Update form. The dialog closes and then click the Continue button in the dialog still on the screen.
  2. In the last step, select what this Forms Relationship Form will do and click to save and close the form and return to the layout. The Forms Relationship Form cell will be inserted into your layout.

Using Views only

To create a form, first go to the Toolset -> Relationship Forms page and click the Add New button at the top. A wizard will appear and guide us through the following steps.

  1. The wizard starts with general instructions on how to use the Relationship Forms.
  2. Give the form a name and click Continue.

  1. In the Form Settings step, select the relationship and page to load after a user submits the form. Click Continue after selecting the desired options.

  1. In the final step of the wizard, we can insert additional fields or rearrange the fields that make up the form’s content.

The dialog displays all the fields related to a relationship. We can drag-and-drop fields to reorder them or click the “trash can” icon to delete specific fields. Fields marked with a “padlock” icon cannot be disabled.

Clicking the button on the right side of each field name reveals additional options for that field (i.e., those that allow us to choose how users will select relationship options).

Click the Finish button to finalize the Relationship Form.

Now that we have created our Relationship Form, let us examine how to use it to create new connections between related posts.

What’s next?

Creating New Connections Between Related Posts