Skip to content

Instantly share code, notes, and snippets.

View low's full-sized avatar
🤖
Multi-tasking

Lodewijk Schutte low

🤖
Multi-tasking
View GitHub Profile
@low
low / events-cal.html
Created November 17, 2016 10:33
Using Ajax to navigate through a Low Events calendar for ExpressionEngine
{!-- events/cal template --}
{if segment_2 == 'cal'}
{preload_replace:pre_date="{segment_3}"}
{/if}
{if segment_2 != 'cal'}
{preload_replace:pre_date="{segment_2}"}
{/if}
{exp:low_events:calendar date="{pre_date}"}
@low
low / low-variables-v2-fieldtype-bridge.md
Created November 25, 2015 13:23
Docs for the Low Variables Fieldtype Bridge for ExpressionEngine 2.

Low Variables v2 Fieldtype Bridge

Instead of making a variable type, you can also choose to create or modify a custom fieldtype. In order to add Low Variables support to your fieldtype, just create it like you normally would, using Pixel & Tonic’s FieldFrame v1.4.3+ for EE1, or EE2’s Fieldtype API. Then, all you need to do is add a couple of methods to your fieldtype class. It’s a lot like adding Matrix support.

display_var_field (required)

Displays the input field on the module home page. You can access the current variable id with $this->var_id.

Arguments

@low
low / low-search-live.js
Last active September 24, 2015 07:56
Low Search Live
/* Requires jQuery */
(function($){
var LowSearchLive = function(el) {
var $keywords = $(el),
$form = $keywords.closest('form'),
resultPage = $keywords.data('result-page'),
threshold = $keywords.data('threshold') || 4,
wait = $keywords.data('wait') || 750,
@low
low / gist:9665729
Created March 20, 2014 14:59
Add LV support to an EE fieldtype, the most basic way: add this to a fieldtype class.
function display_var_field($data)
{
return $this->_display_field("var[{$this->var_id}]", $data);
}
@low
low / low-search-ajax.js
Last active October 18, 2020 13:21
Using Low Search for ExpressionEngine with Ajax. Change any of the three variables on top to suit your needs. Tested with jQuery 1.9.0.
(function($){
$(function(){
var $form = $('#search'), // Search form
$target = $('#results'), // Results container
rp = 'search/ajax-results'; // Template for results only
// Function to execute on success
var success = function(data, status, xhr) {
$target.html(data);
};
@low
low / gist:3689381
Created September 10, 2012 07:14
Avoid using a tag as parameter value for another tag

Avoid using a tag as parameter value for another tag in ExpressionEngine

Instead of this:

{exp:channel:entries param="{exp:some:plugin}"}
	...
{/exp:channel:entries}

Either use an embed, like this:

@low
low / low-reorder-1-docs.html
Created June 5, 2012 14:20
Low Reorder 1 documentation
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8" />
<meta name="author" content="Lodewijk Schutte | Low" />
<meta name="description" content="go to Low, for Expressionengine Add-ons" />
<title>Low Reorder 1 Documentation</title>
@low
low / gist:1391783
Created November 24, 2011 16:49
Simple EE conditionals turning advanced -- an example
// This will execute the exp:tag if first segment is empty
{if segment_1 != ''}
{exp:class:method}
{if var == "foo"}
Lorem
{if:else}
Ipsum
{/if}
{/exp:class:method}
<?php
/**
* Create files for all templates (EE1)
* Add this to a script somewhere
*/
include PATH_CP.'cp.templates.php';
$CPTMPL = new Templates;
if ( ! empty($errors) )
{
$msg = array();
foreach ($errors AS $line)
{
$msg[] = $this->EE->lang->line($line);
}
$this->EE->session->set_flashdata('errors', $msg);