JSON Filter

Categories

Component ID

2484311

Component name

JSON Filter

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

JSON filter takes JSON object data stored in a field and presents it in a readable form as a filter for a field.

The field can be one of the three types: 'text', 'text_long', 'text_with_summary'.

There are two presentation options:

1. Unordered List
2. Table with nested unordered list for values.

The presentation fits a tree structure for the json and not limited to a flat table.

Installation instructuions:

1. Download module, place it in the modules folder (/sites/all/modules) and enable it

How it works

The filter is just another filter in the display settings of the field. for example, in order to change a field display for a node filed, please do the following:

1. Go to Manage Display (/admin/structure/types/manage/{TYPE}/display)
2. Change the Format to Readable JSON (note that this only works on fields of types 'text', 'text_long' and 'text_with_summary').
3. Click on the gear (edit settings)
4. Chose your presentation type (default - Unordered list) and click update
5. Click on save.

This module works with:

Views: Since filters are also available in views it is easy to use this as a selected fitler for a view. To change the filter of a field in a view, click on the field in the view edit page and switch the formatter to Readable JSON.
Search result: In drupal, it is easy to change the presentation of a search result by enabling it in the bottom of the Manage Display page. After adding the desired custom display settings, you can chose a formatter per setting.

Enjoy