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.
Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
11
Version
1.2.0
License
MIT
Compatibility
Craft 3
Last release
March 6, 2019