Created
August 13, 2011 10:03
-
-
Save curtisblackwell/1143703 to your computer and use it in GitHub Desktop.
Cache and resize images in entries using Lumis imgsizer, Matrix, and Stash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- | |
# FIELDS | |
1. Matrix: images | |
* File: image | |
* PT Pill: alignment (left, right, or block) | |
* Text: description | |
* PT Pill: width | |
2. Textarea/WYSIWYG: body | |
# PLACING IMAGES IN THE ENTRY | |
The entry author will need to enter tags for the images' corresponding row numbers into the body. | |
Ex. `{1}` | |
--} | |
{exp:channel:entries | |
channel = "channel_name" | |
limit = "1" | |
} | |
{!-- This must be before the exp:stash:get tag --} | |
{images} | |
{exp:stash:set name="{row_count}"} | |
{exp:imgsizer:size class="{alignment}" src="{image}" alt="{description}" width="{size}"} | |
{/exp:stash:set} | |
{/images} | |
{exp:stash:get}{body}{/exp:stash:get} | |
{/exp:channel:entries} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment