Useful GridField Tools for Fluent Users
The Silverstripe Fluent module is a great way to deliver a multi-language website in Silverstripe, but it can sometimes pose some challenges, especially when it comes to managing data objects in GridFields.
Here, we'll show you 2 small, inconspicuous tools that can help.
Gridfield Locales Column
Do you get tired of having to click inside a DataObject to check if it is localised or not? There is a very useful Component for GridFields.
It comes included with the fluent module itself, so there is no need to install any other stuff for it.
To add it to your GridField just use the addComponent() method like this:
$fields->addFieldToTab('Root.Main', GridField::create(
'Quotes',
_t(Quote::class . '.PLURALNAME', 'Quotes'),
$this->Quotes(),
GridFieldConfig_RelationEditor::create()
->addComponent(new GridFieldOrderableRows('Sort'))
->addComponent(new VisibleLocalesColumn())
));
Now your GridField gets a new Column which looks like this:

DeleteAllLocalesAction
When dealing with localised DataObjects it always takes some getting used to the fact that the common “Delete” action of GridField can do more than one thing. It is rather a “un-localise the record for this locale OR delete it if the record is only existing in the current locale” more than a simple “delete this record”.
The fluent module has something in store for this issue too: it provides the “DeleteAllLocalesAction” component for GridFields.
$fields->addFieldToTab('Root.Main', GridField::create(
'Quotes',
_t(Quote::class . '.PLURALNAME', 'Quotes'),
$this->Quotes(),
GridFieldConfig_RelationEditor::create()
->addComponent(new GridFieldOrderableRows('Sort'))
->addComponent(new VisibleLocalesColumn())
->addComponent(new DeleteAllLocalesAction())
));
This will add a new option to the little context menu of the grid:
These two simple pieces of functionality are included by default in the Silverstripe Fluent module, but are often missed by developers during implementation. We hope you find them useful!