Skip to content

Instantly share code, notes, and snippets.

View objectivehtml's full-sized avatar

Justin Kimbrell objectivehtml

  • Woodland Park, CO
View GitHub Profile
@objectivehtml
objectivehtml / gist:3761912
Created September 21, 2012 14:48
Manipulate the no_results tag
// Add this to your module tag
if($no_results_prefix = $this->EE->TMPL->fetch_param('no_results_prefix'))
{
if(preg_match('/\\'.LD.'if '.$no_results_prefix.'no_results\\'.RD.'.*\\'.LD.'\\/if\\'.RD.'/us', $this->EE->TMPL->tagdata, $matches))
{
$this->EE->TMPL->no_results = $this->EE->TMPL->parse_variables_row($matches[0], array(
$no_results_prefix.'no_results' => 1
));
}
@objectivehtml
objectivehtml / gist:3784945
Created September 25, 2012 22:51
Get filename from URL
/(((.|\n)*)[\/$])|(\.(.|\n)*)/g
@drewwells
drewwells / gist:4219907
Created December 5, 2012 22:02
Webkit+Moz detect device pixel ratio
var ratio = window.devicePixelRatio ||
(function(i){
var wmq = window.matchMedia;
while( !window.devicePixelRatio && i > 0 &&
!wmq("(min--moz-device-pixel-ratio:" + i/10 + ")").matches ){
i=i-1;
}
return i/10;
})(30);
{exp:stash:set no_results_prefix="nested_" parse_tags="yes"}
{stash:page_title}Contacts{/stash:page_title}
{stash:form}
<div id="basic">
{exp:channel_search:form id="Member Basic" class="search clearfix"}
<div class="basic clearfix">
@objectivehtml
objectivehtml / index.html
Last active December 27, 2015 20:49
Channel Search - Basic Usage (Single Field)
<h3>Form</h3>
{exp:channel_search:form id="Basic Usage"}
<div class="row">
<div class="nine columns">
<div class="row collapse">
<div class="nine columns">
<input type="text" name="q" id="q" value="{form:q}" placeholder="Keywords" />
</div>
<div class="three columns">
@objectivehtml
objectivehtml / index.html
Last active December 27, 2015 20:59
Channel Search - Basic Usage Example (Multiple Fields)
<h3>Form</h3>
{exp:channel_search:form id="Basic Usage Multi"}
<div class="row">
<div class="nine columns">
<div class="row">
<div class="nine columns">
<label for="q">Keywords</label>
<input type="text" name="q" id="q" value="{form:q}" />
</div>
@objectivehtml
objectivehtml / index.html
Last active December 27, 2015 20:59
Channel Search - Creating Custom URL's
<h3>Types of Locations</h3>
<ul>
<li><a href="/channel-search/examples/creating-custom-urls">All Locations</a></li>
<li><a href="/channel-search/examples/creating-custom-urls/restaurants">Restaurants</a></li>
<li><a href="/channel-search/examples/creating-custom-urls/lodging">Logding</a></li>
<li><a href="/channel-search/examples/creating-custom-urls/landmark">Landmarks</a></li>
<li><a href="/channel-search/examples/creating-custom-urls/park">Parks</a></li>
</ul>
@objectivehtml
objectivehtml / ajax-current-location.html
Created November 10, 2013 18:10
Channel Search - Search by Current Location
{exp:channel_search:results id="Geolocation" orderby="distance" sort="asc" limit="5"}
{if is_first_row}
{if prev_page || next_page}
<div class="pagination right">
{if prev_page_url}
<a href="{prev_page_url}"><i class="icon-circle-arrow-left"></i> Prev Page</a>
{/if}
@objectivehtml
objectivehtml / index.html
Last active December 27, 2015 22:49
Channel Search - Search by Proximity
<h3>Map</h3>
{exp:gmap:init id="map" center="United States" zoom="3" style="width:400px;height:300px" class="gmap"}
<hr>
<h3>Form</h3>
{exp:channel_search:form id="Geolocation"}
<div class="row">
@objectivehtml
objectivehtml / ajax-color.html
Created November 11, 2013 21:22
Channel Search - Search by Color
{exp:channel_search:results id="Color Search" orderby="color_proximity" sort="asc"}
{if no_results}
<p>There are no matching photos found.</p>
{/if}
{if has_searched}
{color_photo}
{/if}