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

Generate an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.

Notifications You must be signed in to change notification settings

daltonrooney/svgplaceholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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" />

About

Generate an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages