Tag: many_many

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'...

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'...

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...'...

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 '...

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'...

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'...
RSS feed for this blog