Skip to content

Instantly share code, notes, and snippets.

View ademers's full-sized avatar
🧡

Andrea ademers

🧡
View GitHub Profile
@ademers
ademers / craft-cms-language-toggle.html
Last active October 17, 2017 11:49
Craft CMS: Language Toggle
{# Language switcher #}
{# Loop through all of the site locales, except the current one #}
{% set otherLocales = craft.i18n.getSiteLocaleIds()|without(craft.locale) %}
{% for locale in otherLocales %}
{# Is this an entry page? #}
{% if entry is defined %}
{# Find the current entry in the other locale #}
{% set localeEntry = craft.entries.id(entry.id).locale(locale).first %}
@ademers
ademers / app.scss
Created February 14, 2014 18:43
Zurb Foundation 5.x app.scss
@import "settings";
@import "foundation";
// Or selectively include components
// @import
// "foundation/components/accordion",
// "foundation/components/alert-boxes",
// "foundation/components/block-grid",
// "foundation/components/breadcrumbs",
// "foundation/components/button-groups",
@ademers
ademers / craft-robots.txt
Created October 10, 2013 16:37
Craft: robots.txt
# Don't allow web crawlers to index Craft
User-agent: *
Disallow: /craft/
@ademers
ademers / facebook-post-embed-js.html
Created August 26, 2013 23:12
Facebook: Post embed js
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}
@ademers
ademers / gist:6306887
Created August 22, 2013 13:08
Twitter: tweet embed
<blockquote class="twitter-tweet"><p>We can now embed Public Facebook Posts on websites.&#10;&#10;<a href="http://t.co/Bmqpq3GgSB">http://t.co/Bmqpq3GgSB</a></p>&mdash; Andrea DeMers (@ademers) <a href="https://twitter.com/ademers/statuses/370530357390888960">August 22, 2013</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
@ademers
ademers / .gitignore
Created August 19, 2013 15:40
Statamic: .gitignore
# Statamic #
######################
# Ignore all files in _cache dir
_cache/
# Ignore all log files in _logs/ dir, if logging enabled
_logs/
# Ignore all files in transformed images dir
photos/resized/
@ademers
ademers / statamic-author-first-last-name.html
Created July 10, 2013 15:18
Statamic: Author First & Last Name
{{ member:profile member="{ author }" }}
{{ first_name }} {{ last_name }}
{{ /member:profile }}
@ademers
ademers / statamic-transform-tag.html
Created July 7, 2013 17:18
Statamic: {{ transform }} tag
<p><img src="{{ transform src="{ image_file }" width="594" }}" alt="{{ title }}" width="594"></p>
@ademers
ademers / safecracker-rte-simplified.html
Created May 1, 2013 15:54
SafeCracker RTE Simplified
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Blog/publish</title>
<meta name="description" content="">
@ademers
ademers / gist:5445209
Last active December 16, 2015 13:59
EECMS Safecracker with RTE field
{exp:safecracker
channel="blog"
allow_comments="yes"
return="blog/URL_TITLE"
datepicker="no"
include_jquery="no"
error_handling="inline"
form_class="form-horizontal"
safecracker_head="yes"
author_only="yes"