Skip to content

Instantly share code, notes, and snippets.

View kmgdevelopment's full-sized avatar

Kristen Grote kmgdevelopment

View GitHub Profile
@kmgdevelopment
kmgdevelopment / paypal_donate.html
Created May 18, 2012 16:28
Secure Paypal Donate Button with Custom Amount Field
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="[Your Secure Merchant ID]" >
<input type="hidden" name="cmd" value="_donations" >
<input type="hidden" name="item_name" value="[Donation Description]" >
<input type="hidden" name="return" value="http://yourdomain.com/thank-you" >
<div>
<label for="amount">Donation Amount:</label>
<input name="amount" type="text" id="amount" >
</div>
<input name="submit" type="submit" value="Donate" >
@kmgdevelopment
kmgdevelopment / gist:2778121
Created May 23, 2012 22:07
Auto-Submitting Dropdown
<script>
$('form select').change(function(){
$('form').submit();
});
</script>
<form action="boo" method="post">
<select name="beatles">
<option value="john">John</option>
<option value="paul">Paul</option>
@kmgdevelopment
kmgdevelopment / gist:2789080
Created May 25, 2012 16:34
ExpressionEngine Sub-Category Dropdown Menu
<form name="catmenu" action="">
<label for="cat-select">Choose A Category</label>
<select id="cat-select" name="selcat">
<option value="">-- Select --</option>
{exp:channel:categories channel="mychannel" disable="category_fields" style="linear"}
{if parent_id == '0'}
<option value="{path='mychannel'}">{category_name}</option>
{/if}
{if parent_id != '0'}
<option value="{path='mychannel'}" class="subcat">&#8627; {category_name}</option>
@kmgdevelopment
kmgdevelopment / ee_rre
Created June 8, 2012 21:13
EE Reverse Related Entries
{exp:channel:entries channel="learning-category" dynamic="no"}
{reverse_related_entries channel="activities"}
<a href="{title_permalink='activities/detail'}">{title}</a>
{/reverse_related_entries}
{/exp:channel:entries}
@kmgdevelopment
kmgdevelopment / better-meta-pre-replace
Created June 19, 2012 19:41
NSM Better Meta & Preload Replacements
{preload_replace:page_title="{embed:page_title}"}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{exp:channel:entries limit="1"}
{exp:nsm_better_meta:template
entry_id="{entry_id}"
@kmgdevelopment
kmgdevelopment / better-meta-pre-replace.html
Created June 19, 2012 19:42
NSM Better Meta & Preload Replacements
{preload_replace:page_title="{embed:page_title}"}
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset=utf-8" />
{if page_title}
<title>{page_title}</title>
{if:else}
@kmgdevelopment
kmgdevelopment / gist:3024254
Created June 30, 2012 15:29
Low Variables & PHP Redirect
<?php
header( "Location: {exp:channel:entries channel='external_link'}{external_link:var}{/exp:channel:entries}" );
exit;
?>
<!-- This gives me the error: "The URI you submitted has disallowed characters." -->
<!-- And the URL looks like this: http://mysite.com/template_group/%7Blv_twitter%7D -->
@kmgdevelopment
kmgdevelopment / gist:3024481
Created June 30, 2012 16:23
Low Variables Single Tag
{exp:channel:entries channel='external_link'}{exp:low_variables:single var='{external_link}'}{/exp:channel:entries}
{exp:channel:entries channel='external_link'}{exp:low_variables:single var='{external_link:var}'}{/exp:channel:entries}
@kmgdevelopment
kmgdevelopment / gist:3043638
Created July 3, 2012 21:59
Ajax Pagination
$('#pager a').click(function(e){
e.preventDefault();
var theUrl = $this.attr('href');
$.ajax({
url: theUrl,
success: function(data){
var results = $(data);
var finalResults = results.filter('#preResults').html();
@kmgdevelopment
kmgdevelopment / gist:3043651
Created July 3, 2012 22:00
Ajax Pagination
$('#pager a').click(function(e){
e.preventDefault();
var theUrl = $this.attr('href');
$.ajax({
url: theUrl,
success: function(data){
var results = $(data);
var finalResults = results.filter('#preResults').html();