Skip to content
Advertisement

Store multiple fields in JSON column (Nova CMS)

I have a posts table that has a json column “read_more_section”.

And I want to store on that column the information regarding some fields on the NOVA CMS (title, description, label and link). Do you know how to properly do that in Nova? To store what is entered in these 4 fields in the json column “read_more_section”?

JavaScript

Advertisement

Answer

You could make a getter and setter, catch the values of these fields and convert it to a json object.

or you can do it with https://github.com/whitecube/nova-flexible-content and just set a limit of 1 in the layout.

https://whitecube.github.io/nova-flexible-content/#/?id=limiting-layouts-per-type https://whitecube.github.io/nova-flexible-content/#/?id=limiting-layouts

Nova resource

JavaScript

ReadMoreLayout.php

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement