Skip to content

Instantly share code, notes, and snippets.

View Natetronn's full-sized avatar

Nathan Doyle Natetronn

View GitHub Profile
$this->EE->load->driver('channel_data');
$entries = $this->EE->channel_data->get_channel_entries($channel_id);
foreach($entries->row() as $row)
{
$member = $this->EE->channel_data->get_member_entries($row->author_id);
$data_map = array(
'landscapes_1' => array(
@Natetronn
Natetronn / sha1-passwords.php
Created August 9, 2013 19:05
Generate SHA1 hashes for passwords (don't leave this lying around on your live server of course!)
<?php
$passwords = array(
'somepassword',
'anotherpassword',
'onemorepassword'
// so on and so forth (don't forget the trailing commas)
);
// convert passwords to SHA1 hashes

Templating in EE vs. Craft

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.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops
@Natetronn
Natetronn / ee-edit-link.html
Last active January 4, 2016 21:19
Edit Entry - ExpressionEngine
#!/bin/sh
# Import a remote database into a local database
# ----------------------------------------------
#
# Based on http://danherd.net/quick-script-synchronise-from-a-remote-expressionengine-database/
#
# Don’t forget chmod +x to make the script executable.
#
# Change the extension to .command to run the script directly from OS X Finder.
@Natetronn
Natetronn / stash-columns.html
Created July 22, 2014 18:58
An easy way to build Columns in ExpressionEngine using Stash - This is a 2 column, 10 item per column, with pagination example
{exp:stash:set_list name="directory" parse_tags="yes"}
{exp:channel:entries channel="profile" disable="categories|category_fields|profile_data|pagination" status="open" limit="200"}
{stash:company}{profile_company}{/stash:company}
{stash:first_name}{profile_first_name}{/stash:first_name}
{stash:last_name}{profile_last_name}{/stash:last_name}
{stash:title}{profile_title}{/stash:title}
{stash:address}{profile_address}{/stash:address}
{stash:address2}{profile_address2}{/stash:address2}
@Natetronn
Natetronn / quotes
Created March 16, 2015 17:29
Thoughts on quotes
Quotes can be damaging if read from the wrong state of mind. Some of us forget a whole life of successes can not be wrapped into one sentence. Life is not always so easily repeated.
@Natetronn
Natetronn / .editorconfig
Created April 16, 2015 23:15
Craft CMS Editor Config with PT Coding Standards - Find your IDE/Editor here: http://editorconfig.org/#download
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@Natetronn
Natetronn / craft-specific-syntax.md
Last active August 29, 2015 14:19
Craft CMS Project Specific Syntax Highlighting for HTML (Twig)
# Maintainer: Zach Hoffman <zach@zrhoffman.net>
pkgname=docksal
pkgver=1.13.1
pkgrel=1
epoch=1
pkgdesc='All-purpose web-development environment based on Docker and Docker Compose.'
arch=('any')
url='https://docksal.io/'
license=('MIT')