{{craftSnippets}}
Home Articles Plugins Starter theme Components on Github Gists About
  • Home
  • Tags

#macro

2 years ago

Placeholder image macro for Craft CMS

By using simple Twig macro, you can generate a placeholder image with specific dimensions.
#macro
3 years ago

Working with dates in Craft CMS templates

Learn how dates work in Twig, and improve your templates with "time ago" and "default date format" Twig macros.
#macro
3 years ago

Working with SVG images in Craft CMS templates

Learn how to load, process and modify SVG images in Craft CMS templates using Twig macro.
#macro
3 years ago

Responsive and lazy-loaded youtube videos with Craft CMS

In this article, you will learn how to create responsive and lazy-loaded embedded youtube player in Craft CMS templates using Twig macro.
#macro #twig
3 years ago

Truncating text with Twig macros in Craft CMS

These Twig macros will allow you to truncate text - by a number of words or number of characters, without splitting words.
#macro
3 years ago

Read time macro for Craft CMS

This macro will return read time in human readable format, adjusted to your site locale.
#macro
3 years ago

Converting email addresses into links using Twig macro

Learn how to turn email addresses in text into "mailto" links that are secured from email harvesting spam bots.
#macro #email
3 years ago

Fetching routes into Twig templates in Craft CMS

Most Craft developers hardcode routes structure within links created in Twig templates. There is however a way to fetch routes directly into templates and avoid creating duplicate code.
#routing #macro
Copyright ©2023 Piotr Pogorzelski