Ajax Driven Dropdown Lists for ProcessWire made easy

Column Settings: Relationship

This setting consists of 9 pre-set relationship types selectable in a <select> list/input. Each relationship describes how a dependent dropdown is linked to is its trigger (as previously described). The 9 present data relationships types are:

  1. None: This is only valid for the first dropdown. The explanation for this is the same as the one given for a 0 value for the trigger of for the first dropdown.
  2. Child: The dependent dropdown data are the children of the page selected in the trigger dropdown.
  3. Parent: The dependent dropdown data is the parent of the page selected in the trigger dropdown.
  4. Page: The dependent dropdown data are the pages that use the template selected in the trigger dropdown.
  5. Group: The dependent dropdown data are the pages that have the page selected in the trigger dropdown in their named pagefield (similar to what pages use the category X?)*.
  6. Field: The dependent dropdown data are the fields present in the page selected in the trigger dropdown.
  7. Value: The dependent dropdown data are the values of the named-field of the page or field selected in the trigger dropdown.
  8. User: Property: The dependent dropdown data are the properties (basically fields) for the user selected in the trigger dropdown.
  9. User: Value: The dependent dropdown data are the values of the named-field of the selected user or selected property in the trigger dropdown.

Please note that not all relationships for a given trigger are valid for the relationship of the dependent dropdowns. For instance, a dropdown whose relationship is set as Field cannot be a trigger for a dropdown who relationship is specified as Child. Logically, it would not make sense. A ProcessWire field cannot have children! All invalid relationship and trigger situations are discussed in a later topic.

Please also remember that relationships are always described as how is the dependent dropdown connected to its trigger dropdown?

*For instance, a trigger dropdown named sizes might be populated with pages denoting the size of clothes, i.e. Small, Medium, Large. Its dependent dropdown named colours would have a relationship defined as Group and for its data source, some pagefield (e.g. one called tshirt_sizes). Selecting, for instance, the value Medium in the trigger dropdown sizes would initiate a ProcessWire find for pages that have the page Medium selected in their pagefield tshirt_sizes and populate the dependent dropdown colours with the results (e.g. Red, Blue, Yellow), meaning, there are T-shirts of these colours for the size Medium.