Part of the toolkit for Craft being developed at GravityFree Studios. Macro Kit provides several functions that can be imported into your front-end templates for use in Craft CMS.
- abbrStateName - Given a full US state name this returns the abbreviated name of that state.
- dateRange - Given two dates within the same month, this returns a formatted date range.
- fullStateName - Given an abbreviated US state this returns the full state name.
- linkToIf - Given a condition this wraps a block within a link if the condition is met.
- ordinalNum - Given a number this returns the number with its ordinal suffix: 1 => 1st
- randomString - Generates a random string of numbers and letters given a specific length.
- summarize - Takes a block of HTML text, strips the tags and trims it to match a given length in characters.
- stripPhone - Takes a formatted phone number string and strips all non-numeric values to return only the numbers.
To install this plugin, search for its package name on the Plugin Store and click “Install”.