mijingo/liefer

Consumes JSON and makes it available in your Twig templates.

Installs: 1 082

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Type:craft-plugin

0.0.2 2018-02-28 15:37 UTC

This package is auto-updated.

Last update: 2024-04-29 03:12:52 UTC


README

A plugin for Craft CMS 3 that consumes Element API JSON and makes it available in your Twig templates.

Requirements

This plugin requires Craft CMS 3.0.0-RC1 or later and a valid JSON file generated by Craft's Element API.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require mijingo/liefer
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Liefer.

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.

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.

Liefer Roadmap

Some things to do, and ideas for potential features:

  • Add caching support

About

Brought to you by Mijingo

JSON File by useiconic.com from the Noun Project