Skip to content

Instantly share code, notes, and snippets.

View kmgdevelopment's full-sized avatar

Kristen Grote kmgdevelopment

View GitHub Profile
{exp:stash:parse process='end' no_results_prefix='rating'}
{exp:channel:entries
channel='{product_channels}'
entry_id='{stash:entry_ids}'
limit='7'
disable='member_data|category_fields'
orderby='title'
sort='asc'
paginate='both'
status='not closed'
@kmgdevelopment
kmgdevelopment / gist:6783837
Created October 1, 2013 19:31
gzip compression
<IfModule mod_deflate.c>
# Force compression for mangled headers.
# http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
{!-- if the template is requested with Ajax, return JSON data. Otherwise, display a normal page --}
{if ajax}
{exp:http_header content_type='application/json'}
{"success": {if error == 1}false{if:else}true{/if}, "heading": "{heading}", "message": "{exp:low_replace find='NEWLINE'}{content}{/exp:low_replace}"}
{/if}
{if not_ajax}
{embed='_global/document_head' page_title='{heading}'}
<body class="single">
{header}
@kmgdevelopment
kmgdevelopment / gist:6310237
Last active December 21, 2015 13:08
ajax form
var formReturn = '.form-return';
var $submitBtn = $(this).find('input[type="submit"]');
$('form.ajax').ajaxForm({
beforeSubmit: function(){
$submitBtn.attr('value', 'Submitting...');
},
target: formReturn,
success: function(){
$(formReturn).show();
{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('jane@acmeinc.com', 'eric@ericlamb.net'),
'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">