Skip to content

Instantly share code, notes, and snippets.

View iainurquhart's full-sized avatar

Iain Urquhart iainurquhart

View GitHub Profile
@iainurquhart
iainurquhart / gist:1921456
Created February 27, 2012 04:42
pointee views/field.php
<div id="<?=$field_name?>_pointee_img" class="pointee_wrapper">
<div class="inset">
<? if($fixed_img_url != ''):?>
<img src="<?=$fixed_img_url?>" class="pointee_image" />
<div class="pointee_map_marker pointee_<?=$color?>"></div>
<? elseif($display_image !=''): ?>
<img src="<?=$display_image?>" class="pointee_image" />
<div class="pointee_map_marker pointee_<?=$color?>"></div>
<? else: ?>
<p class="pointee_get_started"><?=lang('upload_select_prompt')?></p>
@iainurquhart
iainurquhart / gist:1875423
Created February 21, 2012 09:30
Stash and Taxonomy, example usage
<!--
PARENT TEMPLATE, /pages for example
-->
{exp:channel:entries limit="1" disable="member_data|pagination|categories"}
<!-- set the node -->
{exp:taxonomy:set_node tree_id="1" key="entry_id" val="{entry_id}" var_prefix="this_"}
<!-- stash the nav -->
@iainurquhart
iainurquhart / gist:1873631
Created February 21, 2012 04:18
Next/Prev Node tags
{exp:channel:entries limit="1"}
<!-- set the current node -->
{exp:taxonomy:set_node tree_id="1" key="entry_id" val="{entry_id}" var_prefix="this_"}
<!-- Le Nav -->
<nav>
{exp:taxonomy:nav auto_expand="yes"}
<a href="{node_url}">{node_title}</a>
{/exp:taxonomy:nav}
@iainurquhart
iainurquhart / gist:1435861
Created December 5, 2011 23:16
matrix hack for channel entries api
<?php
// hacks to ft.matrix.php to allow import of matrix data via channel_entries api
// which doesn't call the validate() method in the fieldtype
// --------------------------------------------------------------------------------
// CHANGE 1
// update save method which is currently:
/**
@iainurquhart
iainurquhart / gist:1392770
Created November 25, 2011 03:44
typical page template
{exp:channel:entries
channel="pages_about"
limit="1"
status="open"
disable="{global:param_disable_default}"
require_entry="yes"} {if no_results}{redirect="404"}{/if}
{gv_html_open}
<title>{if title_override}{title_override}{if:else}{title}{/if}</title>
<meta name="description" content="{if meta_description}{meta_description}{if:else} {gv_global_meta_description}{/if}" />
<meta name="keywords" content="{if meta_keywords}{keywords}{if:else}{gv_global_meta_keywords}{/if}" />
@iainurquhart
iainurquhart / gist:1260686
Created October 4, 2011 01:08
example screensteps template
[-- START CONFIGURATION --]
web safe= true
web safe delimiter=_
text style= html
text encoding= utf8
font family = helvetica
newline = unix
media folder= images/@LESSON_NAME
image format=png
@iainurquhart
iainurquhart / gist:1253103
Created September 30, 2011 08:30
set_node
{exp:channel:entries channel="static" limit="1" sort="asc"{if segment_2} require_entry="yes"{/if}}
{if no_results}{redirect="404"}{/if}
<html>
<head>
{exp:taxonomy:set_node tree_id="1" key="entry_id" val="{entry_id}" var_prefix="this_"}
{styles}
<title>{title} {if segment_2}// {exp:taxonomy:breadcrumbs titles_only="yes" reverse="yes" include_here="no" delimiter=" :: "}{/if}
</title>
@iainurquhart
iainurquhart / gist:1244591
Created September 27, 2011 08:17
Pointee Example
<style type="text/css">
.image {position: relative;}
.image span {
position: absolute;
background: red;
width: 15px;
height: 15px;
border-radius: 15px;
}
</style>
@iainurquhart
iainurquhart / gist:1182497
Created August 31, 2011 00:18
taxonomy bugfix
FROM LINE 182 to 194 OF: system/expressionengine/third_party/taxonomy/mcp.taxonomy.php
// build our member_groups array for our multiselect options
foreach( $member_groups as $member_group )
{
// only add to the array if the member group can actuall access the taxonomy module
if( $this->EE->ttree->can_access_taxonomy($member_group['group_id']) )
{
$this->table->set_heading(
array('data' => lang('id'), 'colspan' => '6')
);
$this->table->add_row(
array('data' => $data,
'colspan' => '6',
'style' => 'background: #fff; border-bottom-width: 10px;')
);