Liefer
A plugin for Craft CMS 3 that consumes Element API JSON and makes it available in your Twig templates., (*1)
Requirements
This plugin requires Craft CMS 3.0.0-RC1 or later and a valid JSON file generated by Craft's Element API., (*2)
Installation
To install the plugin, follow these instructions., (*3)
-
Open your terminal and go to your Craft project:, (*4)
cd /path/to/project
-
Then tell Composer to load the plugin:, (*5)
composer require mijingo/liefer
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Liefer., (*6)
Liefer Overview
Pass in a JSON URL or location (best is one generated by the Element API) and then output the data to your Twig template., (*7)
Using Liefer
{% set quotes = craft.liefer.get({url: 'https://something.com/quotes.json')} %}
{% for quote in quotes %}
{{ quote.body }}
{% endfor %}
Enable caching on the Element API source., (*8)
Liefer Roadmap
Some things to do, and ideas for potential features:, (*9)
About
Brought to you by Mijingo, (*10)
JSON File by useiconic.com from the Noun Project, (*11)