Skip to content

Instantly share code, notes, and snippets.

@electricputty
electricputty / gist:3952330
Created October 25, 2012 12:34
Matrix -> Playa -> Matrix
{cf_work_row1} {!-- matrix --}
{cf_work_row1_proj} {!-- playa --}
{title} <- THIS WORKS!
{cf_project_feature:table cellspacing="0" cellpadding="0"} {!-- matrix --} <- THIS WORKS
img: {cf_project_feature} {!-- matrix --}
{cf_project_feature_img} <- THIS DOESNT WORK
First set:
(0.067957 / 16.16MB) Stash: SET proj_list to value |+|proj_title|=|MS Society|&|proj_url|=|ms-society|&|proj_cat|=|{exp:gwcode_categories entry_id='196' style='linear' limit='1'}{cat_url_title}{/exp:gwcode_categories}|&|proj_img|=|http://xxx.xxx.xxx/uploads/images/hawkhurst.jpg|&|proj_size|=|{exp:low_random:number from="2" to="4"}
Retrieve:
(0.070703 / 16.12MB) Stash: RETRIEVED proj_list with value |+|proj_title|=|MS Society|&|proj_url|=|ms-society|&|proj_cat|=|{exp:gwcode_categories entry_id='196' style='linear' limit='1'}{cat_url_title}{/exp:gwcode_categories}|&|proj_img|=|http://xxx.xxx.xxx/uploads/images/hawkhurst.jpg|&|proj_size|=|{exp:low_random:number from="2" to="4"}|+|proj_title|=|Lambeth Council|&|proj_url|=|lambeth-council|&|proj_cat|=|{exp:gwcode_categories entry_id='197' style='linear' limit='1'}{cat_url_title}{/exp:gwcode_categories}|&|proj_img|=|http://xxx.xxx.xxx/uploads/images/theoldcourtroom.jpg|&|proj_size|=|{exp:low_random:number from="2" to="4"}
And the problem area:
======
My set tag:
{exp:stash:set parse_tags="yes" parse_depth="2"}
{exp:channel:entries channel="project" category="{segment_2_category_id}" disable="member_data|pagination" dynamic="no" orderby="random"}
{exp:stash:append_list name="proj_list"}
{stash:proj_title}{title}{/stash:proj_title}
{stash:proj_url}{url_title}{/stash:proj_url}
{stash:proj_cat}{exp:gwcode_categories entry_id='{entry_id}' style='linear' limit='1'}{cat_url_title}{/exp:gwcode_categories}{/stash:proj_cat}
{stash:proj_img}{cf_project_feature limit="1"}{cf_project_feature_img}{/cf_project_feature}{/stash:proj_img}
{stash:proj_size}{exp:low_random:number from="2" to="4"}{/stash:proj_size}
@electricputty
electricputty / gist:3799344
Created September 28, 2012 11:46
Marker parameters
// Google Map Custom Marker Maker 2012
// Please include the following credit in your code
// Sample custom marker code created with Google Map Custom Marker Maker
// http://powerhut.co.uk/googlemaps/custom_markers.php
var point = new google.maps.LatLng(50.875311, 0.351563);
var myMapOptions = {
zoom: 5,
$chars = $this->EE->TMPL->fetch_param('chars');
$words = $this->EE->TMPL->fetch_param('words');
$cutoff = $this->EE->TMPL->fetch_param('cutoff');
$append = $this->EE->TMPL->fetch_param('append', '');
$allow = $this->EE->TMPL->fetch_param('allow');
/** -------------------------------------
/** Initiate parameters and vars
/** -------------------------------------*/
$params = array(
'entry_id' => '',
'url_title' => '',
'weblog_id' => '',
'weblog' => '',
'custom_field' => '',
@electricputty
electricputty / gist:3350316
Created August 14, 2012 15:34
Unnecessary EE directories
/themes/wiki_themes
/themes/site_themes
/themes/profile_themes
/themes/cp_themes/corporate
@electricputty
electricputty / gist:3313806
Created August 10, 2012 12:04
EE add-ons
Base add-ons:
SnippetsSync [http://devot-ee.com/add-ons/snippetssync/] - Free, enables snippets and global variables to be saved as flat files
Switchee [http://devot-ee.com/add-ons/switchee/] - Free, duplicates and extends on php’s switch statement using simple EE code
Expresso/Wygwam [http://devot-ee.com/add-ons/expresso/ or http://devot-ee.com/add-ons/wygwam/] - Paid, WYSIWYG editors
EE Hive Hacksaw [http://devot-ee.com/add-ons/hacksaw/] - Free, text truncating plugin
CE Image [http://devot-ee.com/add-ons/ce-image/] - Paid, Image resizing plugin
Better Workflow [http://devot-ee.com/add-ons/better-workflow/] - Paid, workflow and entry preview
Situational:
Matrix [http://devot-ee.com/add-ons/matrix/] - Paid, fieldtype that enables tabular data rows to be inputted. E.G. photo gallery
@electricputty
electricputty / gist:3313789
Created August 10, 2012 11:56
Basic editorial template
{sp_header}
{exp:channel:entries channel="editorial" disable="categories|category_fields|member_data|pagination" limit="1"}
<div id="bodyContent">
<h1>{title}</h1>
{cf_editorial_body}
{sp_page_actions}
</div>
@electricputty
electricputty / database.php
Created August 10, 2012 11:10
Our master database.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
switch($_SERVER['HTTP_HOST']) {
case 'local.dev':
$active_group = 'local';
break;
case 'test.site':
$active_group = 'test';
break;