What is a Formlink?
When a Entry is edited we what to have the possibiltity to not only edit the values of the entry, we also what to connect entries together.
Whats is the Concept in the Background?
Example:
We edit a Project Entry and want to link persons to te project. So somehow we have do define which connection should be possible.
Parameters:
- Project
- Form
- Parent Entry
- Child Entry
- DataTable
- Datatable LinkModal (Optional)
- Title
- Show Only unlinked entries
- Link button
- Min LInks
- Max Links
- Order
Title:
This title is show in the Modal as Title of the DataTable
Form:
Child Entity:
Which Entity is used as a Child? For each link we get an entry in the table wp_wr_link.
DataTable:
Only DataTables which contains the Child Entity are visible. The DataTable is Displayed in Modal of the Form.
LinkModal DataTable:
If you want to use a Different DataTable in the Link Modal (Eg. without subtables, show only specific informations, etc..) you can create one and select this datatable here.
Link Button:
The default case is to “create and link” an entry to a parrent. if it should be possible to do linking without create a new entriy, this option is for you
Show only unlinked entries
Min. Links:
If this option is set, you can give the user the hint, that you expect a number of links. Like a Invoice has to have Invoice Positions.
Due to technical reasons (you cannot force users to link), this is only informal.
Max. Links
In some cases, you what to limit the number. Eg a Project should only have one manager.
Sort Order:
This is the Order the FormLinks (DataTables) are displayed in the modal.
Info URL
Option: disable_filter_by_link = true
Allow disabling filter by link feature (This can be useful if we what to show linked and unlinked entries (maybe unioned))
Example: Persons some linked categories and some calculated. After a union with the linked_to, only the linked would be shown.
If we disable it, we have to filter the query itself by join to parent id and union the calculated entries.
Options:
link_as_entity:
Link as different entity, defined by Formlink Option
key: link_as_entity, value: entity_identifier
hide_row_link_button = true => Disables Link Button in DataTable