Customize Divshot by Providing JSON?

138 views Asked by At

I am interested in using Divshot to design custom pages and forms for our backend system.

I would like to have the Name attribute in the Divshot inspector of form fields be a select pull-down, where the list would be populated from JSON retrieved from a URL configured at the Project level.

In this way, I could create a Divshot project. In the project settings I could specify a "Custom Data JSON URL". Divshot could then retrieve the JSON from the specified URL, and use it to populate lists (name, and class in this case).

This would be a simple and minimally-invasive way to do some neat integration: By simply creating a list of available field names in the JSON file I could make it possible for the designer to select the desired backend database field name when dropping the HTML control on the canvas.

What do you think of this approach?

In the future this basic JSON approach could also be used to pass in other useful data to Divshot. For example, the JSON could include a property that contained the default HTML for a new page, lists of available Image URL's, default classes to include, etc.--all would be project-specific settings, without needing for Divshot to administer or store those values internally.

For phase 2, it would be interesting to explore including other data attributes in the JSON, such as name-value-pair lists of options for select fields, project-specific classes, and more.

In the future you could also expand the capabilities by allowing the lists in the JSON data to include an applicable class name--and then you could filter a list based on whether that class name appeared in the hierarchy of the control: for example by setting a class of "MyTable1" to a , when adding form fields to the you could include in the list of possible Name values those names associated with class "MyTable1", and exclude those values associated with "MyTable2".

In summary: let externally-stored project-specific JSON drive Divshot property options.

0

There are 0 answers