Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Block Grid | |
// Technique adapted from Foundation 5 for Bootstrap 3. | |
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss | |
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM) | |
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme) | |
[class*="block-grid-"] { | |
display: block; | |
margin: -($grid-gutter-width/2); | |
padding: 0; |
#GoPro HERO4 (A tale of firmware leaks and marketing)
Written by /u/konrad-iturbe (Konrad Iturbe) and with help of /u/OverByThere's leaked firmware.
The GoPro HERO4 Black Adventure edition is 4x times more powerful than ever.
HERO4 cameras:
- HERO4 Black (BANZAI)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Load Google Maps for geocoding of postcode --> | |
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> | |
<!-- Check we have a valid UK postcode before attempting geocode lookup --> | |
<script> | |
function checkPostCode(toCheck) { | |
// Permitted letters depend upon their position in the postcode. | |
var alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1 | |
var alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro truncate(text, limit, append) %} | |
{# settings #} | |
{% set suffix = append|default('...') %} | |
{% set punctuation = ['.',',','-',':',';'] %} | |
{# logic #} | |
{% set array = text|split(' ') %} | |
{% set arrayTruncated = array|slice(0, limit) %} | |
{% set string = arrayTruncated|join(' ') %} | |
{% if limit and array|length > limit %} | |
{% for mark in punctuation %} |
OlderNewer