Skip to content

Instantly share code, notes, and snippets.

View jeromecoupe's full-sized avatar
💭
coding away

Jérôme Coupé jeromecoupe

💭
coding away
View GitHub Profile
@jeromecoupe
jeromecoupe / clearingfloats.css
Created February 26, 2012 11:05
Float Clearing Styles
/* =Clearing floats without markup
To be combined with a Paul Irish approach of ie specific styles
<http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/>
---------------------------------*/
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
@jeromecoupe
jeromecoupe / gist:2567707
Created May 1, 2012 12:37 — forked from croxton/gist:1505601
User friendly modal windows for touch devices using Colorbox and Modernizr
$(document).ready(function(){
// colorbox
if ($('#modal').length > 0) {
var modalConfig = {
inline : true,
href : "#modal",
opacity : .75,
onLoad:function(){
$('#modal').css('display','block');
@jeromecoupe
jeromecoupe / use switch to open and close divs
Last active October 5, 2015 20:08
ExpressionEngine: Insert a <div> every x rows within a loop without PHP
{exp:channel:entries channel="news"}
{if '{switch="one|two|three"}' == "one"}<div class="row">{/if}
... something ...
{if '{switch="one|two|three"}' == "three" || count == total_results}</div>{/if}
{/exp:channel:entries}
@jeromecoupe
jeromecoupe / gist:3426115
Last active October 9, 2015 02:47
Sublime Text 2 User Config
{
"theme": "Soda Dark.sublime-theme",
"bold_folder_labels": true,
"highlight_modified_tabs": true,
"soda_classic_tabs": true,
"highlight_modified_tabs": true,
"color_scheme": "Packages/User/themes/Monokai.tmTheme",
"font_face": "Inconsolata",
"font_size": 17,
@jeromecoupe
jeromecoupe / gist:3436758
Created August 23, 2012 13:47
exp:ifelse and playa conditionals
<!--
Using this code in an embed, passing the father entry_id as {embed:myentryid}
This works natively but as soon as I add ifelse, it breaks
Could stash value of playa conditionals but rather avoid it if possible
Have tried multiple ways of quoting things
{if "{exp:playa:total_children entry_id='{embed:myentryid}' channel='projects|news|pressreleases|documents' status='open'}" != "0"}
{if {exp:playa:total_children entry_id="{embed:myentryid}" channel="projects|news|pressreleases|documents" status="open"}}
@jeromecoupe
jeromecoupe / gist:3880163
Created October 12, 2012 16:40
Custom pagination with {exp:stash:get_list} and filtering
{!-- Wrapper template --}
{embed="wrappers/page_full_width"}
{!-- Meta data --}
{exp:stash:set name="meta_title"}Our projects{/exp:stash:set}
{exp:stash:set name="meta_description"}Projects of the International Polar Foundation{/exp:stash:set}
{!-- Navigation --}
{exp:stash:set name="nav_current"}projects{/exp:stash:set}
@jeromecoupe
jeromecoupe / eecms safecracker
Created December 20, 2012 20:51
safecrachker and .htacess interactions
1. don't use these rules in your .htaccess if using the exclude method, they prevent safecracker forms from submitting properly. Sorry I forgot about thios.
# Add a trailing slash to paths without an extension
# -------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
OR add a rule not to add a trailing slash for POST requests
@jeromecoupe
jeromecoupe / craftcms .gitignore
Last active September 21, 2020 10:38
craftcms .gitignore (craft 3)
# Craft
# --------------------------
/.env
/vendor/
# files generated by build process
/web/dist/
# user uplodaded files
/web/uploads/
# DB Dumps
// ---
// Sass (v3.2.9)
// ---
@mixin respond-to($queries...) {
$length: length($queries);
@for $i from 1 through $length{
@if $i % 2 == 1 {
@media screen and (min-width: nth($queries, $i)) {
@jeromecoupe
jeromecoupe / Blocking li in #eecms
Last active December 19, 2015 09:39
Block </li></li> together with ExpressionEngine when using inline-block (avoid whitespace bug)
{!-- List last 3 news (blocking the <li></li> together is mandatory due to using inline-block) --}
{exp:channel:entries channel="news" disable="categories|category_fields|member_data|pagination|trackbacks" status="open" orderby="date" sort="desc" dynamic="no" limit="3"}
{if count == 1}<ul><li>{/if}
<article>
<h3><a href="{url_title_path='news-press/index'}">{title}</a></h3>
<p>{exp:eehive_hacksaw words="30" append="&hellip;"}{cf_news_summary}{/exp:eehive_hacksaw}</p>
</article>
{if count == total_results}</li></ul>{if:else}</li><li>{/if}