Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Latest commit

 

History

History
executable file
·
19 lines (11 loc) · 772 Bytes

readme.md

File metadata and controls

executable file
·
19 lines (11 loc) · 772 Bytes

SVG Placeholder plugin for Craft CMS

A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates. Works with Craft 2. For Craft 3 support, check out mblode's fork.

Installation

  1. Unzip file
  2. Place svgplaceholder directory into your craft/plugins directory
  3. Install plugin in the Craft Control Panel under Settings > Plugins

Usage

{{ craft.svg_placholder.generate({height:500,width:'300'}) }}

Example

When used with Lazysizes:

<img class="lazyload" src="{{ craft.svg_placholder.generate({height:500,width:'300'}) }}" data-src="path-to-real-image-500x300.jpg" />