Skip to content

Instantly share code, notes, and snippets.

Avatar

zenbug

View GitHub Profile
View Craft search form with optional category select fields
{#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_includes/library-search-form.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#}
<form action="{{ url('library/results') }}">
{#? Keywords #}
<div class="flex flex-wrap mb-6 -mx-3">
<div class="w-full px-3">
<label class="block mb-2 font-bold tracking-wide text-hbgray-900" for="keywords">Keywords (Optional)</label>
@zenbug
zenbug / Accessible Navigation Menu with Tailwind
Last active Jul 3, 2020
Accessible Navigation Menu with Tailwind
View Accessible Navigation Menu with Tailwind
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
README
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
This is not fully Tailwind because it uses pseudo classes.
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@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 / responsive-images-craft.txt
Last active Jul 14, 2020
Using LazySizes and the Picture element with responsive breakpoints for art-direction in Craft CMS
View responsive-images-craft.txt
{#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_layouts/main-layout.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All image transforms are defined here in the main layout template so they can be used site-wide. Templates using this layout can reference them thus:
{{ theBackgroundImage.url(transform.small) }}
#}
{% set transform = {
small: {