What does it do?
This MODX Snippet consumes JSON (string or file) and, based on the specified properties, will build a string formatted for use in a MODX TV input options field. The result looks something like this:
To produce the result seen in the screenshot above, do the following in your MODX site:
- Create a Chunk with this Snippet call:
- Create a Single-Select TV with @CHUNK binding for "Input Options":
- Resources with the TV enabled will get a list of schema.org itemtype property values, like the screenshot above.
The Snippet code is in a gist. More info can be found in the code comments. Happy MODX-ing!