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
<select id="state" name="state"> | |
<option></option> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> |
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
AddHandler x-httpd-php5-3 .php | |
Options +FollowSymlinks -MultiViews | |
RewriteEngine On | |
RewriteBase / | |
# Send would-be 404 requests to Craft | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] |
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
server { | |
listen 80; | |
root /var/www/craft.dev/public; | |
index index.php index.html index.htm; | |
server_name craft.dev; | |
location / { | |
try_files $uri $uri/ @rewrites; |
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
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name]) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
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
## Packages | |
- [Emmet](http://emmet.io) | |
- [AdvancedNewFile](https://github.com/skuroda/Sublime-AdvancedNewFile) | |
- [GitGutter](https://sublime.wbond.net/packages/GitGutter) | |
## Syntax | |
- [Sass](https://sublime.wbond.net/packages/Sass) |
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
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
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
{# | |
I'm using this to build out a calendar. Not every month/day on the calendar has an event and I don't want a user to go into May 2034 and see nothing. | |
I needed a way to go from the current day and count out to the last event in the database and show everything in between. This is what I ended up doing. | |
This method assumes you have a channel of events. | |
Every event is assigned to an 'event' category with sub categories below it. | |
Every entry has an 'eventTime' date field within it. | |
I'm not worrying about recurring events. It's unneeded for this application. | |
#} |
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
{# Get the category from the slug. This will return one CategoryModel #} | |
{% set topCat = craft.categories.slug('someSlug').first() %} | |
{# Get the first subcategory under the top level category using the getChildren() method on the category model. #} | |
{% set firstSubCat = topCat.getChildren().first() %} | |
{# Grab the first entry under that category using the relatedTo function and appending the .first() method to return only one item. #} | |
{% set firstEntry = craft.entries.relatedTo( firstSubCat ).first() %} | |
{# Set your image from your asset field #} |
OlderNewer