Skip to content

Instantly share code, notes, and snippets.

{# You need to include the 'type' input to identify the matrix block type you are submitting #}
<input type="hidden" name="fields[contact][new1][type]" value="contacts">
{# All of your custom fields must be within a 'fields' array. #}
<input type="text" name="fields[contact][new1][fields][contactname]">
<input type="text" name="fields[contact][new1][fields][contactemail]" >
<input type="text" name="fields[contact][new1][fields][contactphone]" >
{# For New Entries, you'll want to use the naming convention 'new1', 'new2', 'new3' for each of your blocks. For existing entries you can update those values to be the block IDs #}
<input type="text" name="fields[contact][new2][fields][contactname]">
@therealjustinlong
therealjustinlong / gist:a4b1c90d204bbe36b7de
Last active August 29, 2015 14:03
.htaccess for checking if HTTPS or HTTP
<IfModule mod_rewrite.c>
# Custom secure redirect variable:
# Test that HTTPS is on:
# RewriteCond %{ENV:SECURE_REDIRECT} on [NC]
# or
# Test that HTTPS is NOT on:
# @ RewriteCond %{ENV:SECURE_REDIRECT} !on [NC]
{snippet:site-code_header}
{if get:app != "true"}
{snippet:site-header}
{/if}
{if get:app != "true"}
{snippet:partials-hero_short}
{/if}
{exp:channel:entries channel="staff" dynamic="no" category="48" disable="categories|category_fields|member_data|pagination"}
{exp:stash:append_list name="staff" context="{exp:garnish:lowercase}{staff_state_coverage:alpha2}{/exp:garnish:lowercase}" save="yes" output="no" scope="site"}
{stash:staff_member}
{staff_state}
<h3>{staff_state_coverage:name} Locations:</h3>{/staff_state}<div><span>{staff_name}</span><br><span>{staff_position}</span><br><span>{staff_email_address}</span></div>
{/stash:staff_member}
{/exp:stash:append_list}
{/exp:channel:entries}
@therealjustinlong
therealjustinlong / htaccess_trailing_slash_with_post
Created August 1, 2012 17:17
Allows for a trailing slash while still supporting default EE post urls
# Add a trailing slash to paths without an extension
# Does not redirect for POST items like SafeCracker/Store/Comments
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
@therealjustinlong
therealjustinlong / upload_destination_ee_part_config.php
Created July 26, 2012 22:23
ExpressionEngine Upload Preference Array
//I have created global variables that allows my paths to be dynamic per site environment
// This is the format that the arrary needs to be put in //
$config['upload_preferences'] = array(
1 => array( // ID of upload destination
'name' => 'General Upload Directory, // Display name in control panel
'server_path' => $config['base_path'] . '', // Server path to upload directory
'url' => $config['base_url'] . '' // URL of upload directory
),
2 => array(
@therealjustinlong
therealjustinlong / gist:3179696
Created July 26, 2012 01:12 — forked from john-henry/gist:3179683
Infinite Scroll & Masonry in ExpressionEngine
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">