Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.
-
Comments{{ cycle(['odd','even'], loop.index0 }}
{# Shows all categories in the news group #} | |
{% set categories = craft.categories.group('news') %} | |
<ul> | |
{% nav category in categories %} | |
<li> | |
<a title="{{ category.title }}" href="{{ category.url }}">{{ category.title }}</a> | |
{# Output a nested <ul> if this category has any children #} | |
{% ifchildren %} | |
<ul>{% children %}</ul> |
// ---- | |
// Sass (v3.3.8) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
/* Note: The css selectors | |
The 'Grey' changes from UK to USA spelling | |
The Primary colours are all lowercae and not camelcase | |
This is because keys are don't have to be strings. |
Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.
Comments{{ cycle(['odd','even'], loop.index0 }}
{# Open Search #} | |
<link rel="search" type="application/opensearchdescription+xml" href="/news/opensearch.xml" title="Search {{ siteName }}"/> |
<?php | |
return array( | |
'*' => array( | |
'tablePrefix' => 'craft', | |
), | |
'dev' => array( | |
'server' => 'localhost', | |
'user' => 'root', | |
'password' => '', |
Modernizr.addTest('retina', function(){ | |
if (window.matchMedia) { | |
var mq = window.matchMedia("only screen and (-moz-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)"); | |
if(mq && mq.matches) { | |
return true; | |
} | |
} | |
}); |
/* | |
Using silent class | |
*/ | |
.Button, .Random { | |
background: red; | |
} | |
div .Button { | |
color: red; | |
} |
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
/* | |
Using silent class | |
*/ | |
%background { |
{ | |
"bold_folder_labels": true, | |
"detect_indentation": true, | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", | |
".hg", |
# Ask for the administrator password upfront | |
sudo -v | |
# mkdir -p ~/Sites/Work/Clients | |
# mkdir -p ~/Sites/Work/Internal | |
# mkdir -p ~/Sites/Personal | |
# mkdir -p ~/Downloads/Torrents | |
mkdir -p /Volumes/Sites/Work/Clients | |
mkdir -p /Volumes/Sites/Work/Internal |