Product Updates

DatoCMS changelog for new features and general improvements
Plugin SDK exposes blocks usage information
September 15th, 2022

A small addition to our Plugin SDK: it is now possible to retrieve the number of blocks currently used inside a record via the ctx.blocksAnalysis property.

The information is exposed in every hook related to records editing, namely Field extensions, Sidebar panels, and Form outlets:

import React from 'react';
import ReactDOM from 'react-dom';
import { connect, RenderItemFormOutletCtx } from 'datocms-plugin-sdk';
itemFormOutlets(model, ctx) {
return [{ id: 'myOutlet' }];
renderItemFormOutlet(outletId, ctx) {
const {
blocksAnalysis: {
usage: {
/** Total number of blocks present in form state */
/** Total number of blocks present in non-localized fields */
/** Total number of blocks present in localized fields, per locale */
/** Maximum number of blocks per item */
} = ctx;
// render the outlet here