A simple Craft CMS twig extension that returns your object or array of objects as JSON
install the plugin and it will create a new twig filter and an action url
you can use this in any template like so
{% set events = craft.entries.section('events').find() %}
{{ events | json_expand | raw }}
you can also call up all the elements in a section directly by using the action url
/actions/jsonExpand/sections/query?sectionId=4
where the sectionId the id of the section whose entries you want to grab.
Hope to add more filtering options to the action urls shortly.
- Add more filtering by action url
- Add support for more fieldtypes