Skip to content

keithmancuso/craft-json-expand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

JSON Expand Plugin for CraftCMS

A simple Craft CMS twig extension that returns your object or array of objects as JSON

Usage

install the plugin and it will create a new twig filter and an action url

Twig Filter

you can use this in any template like so

{% set events = craft.entries.section('events').find() %}
{{ events | json_expand | raw  }}

Action Url

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.

TODO

  • Add more filtering by action url
  • Add support for more fieldtypes

About

a simple twig filter for Craft CMS to output entry models into json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages