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 hidden or 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
| // 1: To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. | |
| // 2: I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. | |
| // 3: I added this code after long time of searchin, testing, and mashing my head into the wall. | |
| $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); |
This file contains hidden or 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
| <!-- non-retina iPhone pre iOS 7 --> | |
| <link rel="apple-touch-icon" href="apple-touch-icon-57x57.png" sizes="57x57"> | |
| <!-- non-retina iPad pre iOS 7 --> | |
| <link rel="apple-touch-icon" href="apple-touch-icon-72x72.png" sizes="72x72"> | |
| <!-- non-retina iPad iOS 7 --> | |
| <link rel="apple-touch-icon" href="apple-touch-icon-76x76.png" sizes="76x76"> | |
| <!-- retina iPhone pre iOS 7 --> | |
| <link rel="apple-touch-icon" href="apple-touch-icon-114x114.png" sizes="114x114"> | |
| <!-- retina iPhone iOS 7 --> | |
| <link rel="apple-touch-icon" href="apple-touch-icon-120x120.png" sizes="120x120"> |
rsync (Everyone seems to like -z, but it is much slower for me)
- a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
- H: preserves hard-links
- A: preserves ACLs
This file contains hidden or 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
| var $dateTime = new DateTime(); | |
| $dateTime->setTimezone(new DateTimeZone('America/New_york')); | |
| $dateTime->setTimestamp(time()); | |
| $isDst = (bool)$dateTime->format('I') ? "y" : "n"; | |
| $conf['daylight_savings'] = $isDst; |
This file contains hidden or 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
| {exp:structure:nav max_depth="2" show_depth="2" current_class="active" css_class="nav" has_children_class="dropdown"} | |
| <script> | |
| $(function() { | |
| $('ul li.dropdown').each(function() { | |
| $(this).children('ul').addClass("dropdown-menu"); // add children dropdown menu class | |
| $(this).children('a').append('<b class="caret"></b>') // add caret icon | |
| $(this).clone().prependTo($(this).find('ul')).removeClass('dropdown active').children('ul').remove(); // clone parent link into child menu | |
| $(this).children('a').attr('data-toggle', 'dropdown').attr('href', '#').addClass("dropdown-toggle"); // add data attributes to hook up Bootstrap | |
| }); |
This file contains hidden or 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
| The MIT License (MIT) | |
| Copyright (c) James Dennes | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
NewerOlder