Tag: many_many
SS4: edit many_many_extraFields in a GridField detail form
In a recent project I had a $many_many relation between TeamMember and TeamGroup where each member can have a different role per group.
Read more about 'SS4: edit many_many_extraFields in a GridField detail form '...
Read more about 'SS4: edit many_many_extraFields in a GridField detail form '...
Syncing a ManyManyList
Sometimes you want to update a ManyMany relation to have exact this set of foreign keys. Not just adding and deleting, but both - best in just one call.
Read more about 'Syncing a ManyManyList'...
Read more about 'Syncing a ManyManyList'...
Scaffolding Forms With many_many Relations (And Checkboxes)
In one of my latest projects we have a lot of frontend forms related to DataObjects. Instead of building the FieldList manually we use the form scaffolder, a great tool.
Read more about 'Scaffolding Forms With many_many Relations (And Checkboxes)'...
Read more about 'Scaffolding Forms With many_many Relations (And Checkboxes)'...
How to get all many_many relations of a list
When you have a $many_many relation, e.g. Page m:n RelationTag, it's easy to get all the Tags of one specific Page.
Read more about 'How to get all many_many relations of a list'...
Read more about 'How to get all many_many relations of a list'...
Get Related Pages, or: Filter By Many_Many Relation
On our Slack community channel today one question was, how to get all other pages with the same tags like the current page.
Read more about 'Get Related Pages, or: Filter By Many_Many Relation'...
Read more about 'Get Related Pages, or: Filter By Many_Many Relation'...
Listening to changes in many_many relationships, but not hack the framework...
I wanted to add logging but changes to the relationships wasn't obvious at first and then I remembered I could overide the class managing the relationships...
Read more about 'Listening to changes in many_many relationships, but not hack the framework...'...
Read more about 'Listening to changes in many_many relationships, but not hack the framework...'...
ModelAdmin: filter by $many_many with a dropdown
When you have a DataObject with a $many_many "Tags" => "Tag" you can add a filter dropdown in ModelAdmin by overwriting the scaffoldSearchFields() method:
Read more about 'ModelAdmin: filter by $many_many with a dropdown '...
Read more about 'ModelAdmin: filter by $many_many with a dropdown '...
Get all titles of a many_many component in a GridField summary
Assuming you have a DataObject with $many_many Tags, you can easily add all Tag's Titles comma seperated to $summary_fields using PHP's join method, even sorted by the SortOrder of the...
Read more about 'Get all titles of a many_many component in a GridField summary'...
Read more about 'Get all titles of a many_many component in a GridField summary'...
Sort Tags by popularity, or: how to sort a DataObject by count of many_many relation
Today I did some minor updates on a site with a blog and wanted to show the most popular tags.
Read more about 'Sort Tags by popularity, or: how to sort a DataObject by count of many_many relation'...
Read more about 'Sort Tags by popularity, or: how to sort a DataObject by count of many_many relation'...
Save $many_many_extraFields when adding a DataObject to a list
Assuming you have a $many_many relation and SortOrder defined as $many_many_extraFields you can add an item to this ManyManyList and pass the extraFields as an array:
Read more about 'Save $many_many_extraFields when adding a DataObject to a list'...
Read more about 'Save $many_many_extraFields when adding a DataObject to a list'...