talk about Silverstripe CMS's GridField by Martina Lindenhofer and Werner M. Krauß at SilverStripe EU Conference in Manchester, UK 2025 www.stripecon.eu
Vienna since 2010 • Married, Expecting • Bachelor’s degree in Media Informatics at the University of Vienna • WebDeveloper at pixelpoems since 2020, works with SilverStripe since 2016 • Martina on Slack, MLindenhofer on github • AI Art, Japan, Anime, Manga, Gaming, Cosplay, HEMA
part of the framework since SilverStripe 3 • Successor of UncleCheese’s DataObjectManager in 2.4 • And TableListField / ComplexTableField even before…-
• Many preconfigured configs available: ◦ GridFieldConfig_RecordViewer Readonly viewer ◦ GridFieldConfig_RecordEditor Allow editing of Records ◦ GridFieldConfig_RelationEditor Also allow adding or removing relations in has_many or many_many relationships • You can modify those or write your own subclass ◦ addComponent() / removeComponent()
paginated view of records, with sortable and searchable headers. • GridFieldConfig_RecordViewer ◦ Allows viewing readonly details of individual records • GridFieldConfig_RecordEditor ◦ Allows editing of records contained within the GridField • GridFieldConfig_RelationEditor ◦ Adds features to work on has-many or many-many relationships.
managed with GridFields • GridField configurable for each $managed_modelclass • Tools for importing (ModelAdmin) and exporting (e.g. to CSV or customised Excel) • Method to get GridFieldConfig for each model
a superclass. Example: Superclass → News Subclasses → Events, Podcasts, Seminar • Use ->setClasses() if you don’t want all subclasses in that list • Checks ->canCreate() on all subclasses else
• Adds them to DataObjects which get linked to the current object • See also: https://docs.silverstripe.org/en/6/optional_features/gridfield-bulk-editing-t ools/bulk-uploader/
the GridField. • Out of the box: unlink, delete and bulk editing. • You can also easily create and add your own actions. • See also: https://docs.silverstripe.org/en/6/optional_features/gridfield-bulk-editing-t ools/bulk-manager/
• Supports GridFieldDetailForm_ItemRequest with extra actions • It extends GridFieldDataColumns. • This allows it to take locale-specific values into account when rendering columns in a GridField. • Displaying the translated value (e.g. title, name) in the GridField instead of the raw/default value. • Optionally indicating whether a field in the current locale is localised or inherited. • Ensuring consistent behaviour when switching locales in the CMS (via the locale dropdown in the top-right corner).
a calendar, useful for things like event calendars. It also provides a toggle button that let's you switch between the default list view for a GridField and the Calendar view. • https://packagist.org/packages/webbuilders-group/silverstripe-gridfield-ca lendar-view
lots of examples of useful GridField-Extensions for in use - some examples: • https://github.com/bratiask/silverstripe-pickerfield • https://github.com/silverstripe/silverstripe-gridfield-bulk-editing-tools • https://github.com/UndefinedOffset/SortableGridField • https://github.com/webbuilders-group/silverstripe-frontendgridfield • https://github.com/goldfinch/image-editor • https://github.com/sunnysideup/silverstripe-yes-no-any-filter Thanks for all participants!
• Extends GridField_ColumnProvider ◦ augmentColumns: modifies column list (e.g. adds a column) ◦ getColumnsHandled: names of all affected columns ◦ getColumnContent: actual HTML based on the current record ◦ getColumnAttributes: HTML attributes, e.g. CSS classes; based on current record ◦ getColumnMetaData: can be used by other components => adding your own tool to a GridField isn’t that complicated
Controller for editing a DataObject • Can be the controller if you have custom actions, e.g. buttons etc. for the current item ◦ E.g. send an invoice for the current Order