{{craftSnippets}}
Home Articles Plugins Starter theme About
  • Home
  • Tag list
  • Twig macro

#Twig macro

5 years ago

Placeholder image macro for Craft CMS

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

Using Javascript in Twig templates with Craft CMS

Learn how to use Javascript in Twig templates in order to make your code more portable and maintainable.
#Craft CMS 3 #Twig templating #Twig macro
5 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.
#Craft CMS 3 #Twig macro
5 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.
#Craft CMS 3 #Twig macro
5 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.
#Craft CMS 3 #Twig macro
6 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.
#Craft CMS 3 #Twig macro
6 years ago

Read time macro for Craft CMS

This macro will return read time in human readable format, adjusted to your site locale.
#Craft CMS 3 #Twig macro
6 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.
#Craft CMS 3 #Twig macro
6 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.
#Craft CMS 3 #Twig macro #Outdated articles
Copyright © 2025 Piotr Pogorzelski
piotrpog@protonmail.com      LinkedIn profile      Github profile