Onsave feature in CMS editor

Hi,

I’d like to add a read-time indicator to my blog posts. I’ve seen examples where this is calculated client-side on the fly, but that approach feels inefficient, especially when the read time needs to be displayed in blog listings, such as grids on the home page, feature pages, related posts, or search results etc.

Is it possible to calculate the read time when a post is saved and store it in a CMS field using an “onsave” event? That way, the value can be reused consistently across the site without recalculating it on the client.

Thank you,

D

Hey @dalaws,

You can probably setup an automation via Make / Zapier to listen to events like CMS item published / updates (as your requirement might be) and have a calculation in the scenario which in turn updates the CMS item’s respective field with the reading time based on your logic.

You might have to ensure that the scenario does not loop itself due to the updates done but yeah, you can explore this & setup an automation to handle this automatically. Alternatively you can have the person who creates the blog item fill up the reading time based on the calculation of words if you want it to be a manual process.

Hope this gives you some idea.

1 Like