Skip to content

Instantly share code, notes, and snippets.

View kmgdevelopment's full-sized avatar

Kristen Grote kmgdevelopment

View GitHub Profile
{exp:gwcode_categories
cat_id="1"
style="linear"
parse="inward"
variable_prefix="gw:"
}
{exp:channel:entries
channel="one|two|three"
category="{cat_id}"
dynamic="no"
@kmgdevelopment
kmgdevelopment / gist:5731218
Created June 7, 2013 18:10
Google Analytics Landing Page Redirect

To speed up page load times for visitors of your site, remove as many landing page redirections as possible, and make any required redirections cacheable if possible.

> http://www.domain.com/ is a non-cacheable redirect to https://www.domain.com/

@kmgdevelopment
kmgdevelopment / gist:5569055
Last active December 17, 2015 06:58
Structure/Twitter Bootstrap Nav
{exp:structure:nav
start_from='/{segment_1}'
max_depth='1'
css_class='nav nav-list'
current_class='active'
}
@kmgdevelopment
kmgdevelopment / gist:5215222
Created March 21, 2013 18:04
PHP: XML Job Feed Loop
<?php
$jobs = simplexml_load_file('http://www.domain.com/feeds/jobfeed');
foreach ($jobs->xpath('/jobs/job') as $jobDetails){
$title = $jobDetails->title;
$url = $jobDetails->url;
echo '<li><a href="',$url,'">',$title,'</a></li>';
}
?>
@kmgdevelopment
kmgdevelopment / gist:4512980
Last active December 10, 2015 23:58
Securit:ee Master Config Array
$env_config['securitee'] = array(
'license_number' => '12345',
'disable_accordions' => FALSE,
// ------------------------------------
// File Monitor
// ------------------------------------
'enable_file_monitor' => '1',
'file_monitor_notify_emails' => array('[email protected]', '[email protected]'),
'file_scan_path' => $base_path,
@kmgdevelopment
kmgdevelopment / gist:4496222
Created January 9, 2013 19:48
Dev Docs Broken Code Block - Form

Forms

All forms should be coded with the following structure:


  <form method="post" action="http://mysite.com">
    <input type="hidden" name="foo" value="foo">
    <input type="hidden" name="bar" value="bar" />
    <input type="hidden" name="lorem" value="lorem">
@kmgdevelopment
kmgdevelopment / gist:4496135
Last active December 10, 2015 21:38
Dev Docs Broken Code Block

HTML & Javascript

HTML tags should always use double quotes, javascript should always use single quotes.

HTML <div> tags should always be closed with a comment indicating the div class and/or ID. Example:


<div class="mydiv">
  <a href="#">I'm a link!</a>
</div><!--/.mydiv-->
@kmgdevelopment
kmgdevelopment / gist:4355362
Created December 21, 2012 19:59
Nested Switchee Conditional
{if segment_1 == 'blog'}
{exp:switchee case='{segment_2}' parse='inward'}
{case value='#^P(\d+)$#|""|category|author'}
{!-- Content --}
{/case}
{/exp:switchee}
{/if}
@kmgdevelopment
kmgdevelopment / gist:4112399
Created November 19, 2012 18:09
ExpressionEngine Copyright
Copyright &copy; 2012 {if "{current_time format='%Y'}" >"2012"}- {current_time format="%Y"}{/if}
@kmgdevelopment
kmgdevelopment / gist:4035449
Created November 7, 2012 23:50
EE Error Ajax Return
[<div>, prevObject: e.fn.e.init[1], context: undefined, selector: "#content"]
0: <div>
accessKey: ""
align: ""
attributes: NamedNodeMap
baseURI: ""
childElementCount: 3
childNodes: NodeList[7]
children: HTMLCollection[3]
classList: DOMTokenList