Skip to content

Instantly share code, notes, and snippets.

zenbug

Block or report user

Report or block zenbug

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zenbug
zenbug / include-with-variables
Created Feb 27, 2019
Craft CMS Include with embedded variables
View include-with-variables
{% include "oz/emerald-city with {
"character" : "tinman"
} %}
@zenbug
zenbug / gist:38f0462b461487faadb254e1d493b872
Created Feb 19, 2019
Using LazySizes and the Picture element with responsive breakpoints for art-direction in Craft CMS
View gist:38f0462b461487faadb254e1d493b872
{# Assets can be an array, so we need to add .one() to the end when we only want one asset: #}
{% set theImage = block.image.one() %}
{# Also create variables for all other fields that are used with images: #}
{% set theImageCaption = block.caption %}
{% set theImagePosition = block.imagePosition %}
{#
There are four image position options:
left
right
You can’t perform that action at this time.