Skip to content

Instantly share code, notes, and snippets.

View lauraeddy's full-sized avatar

Laura Eddy lauraeddy

View GitHub Profile
@lauraeddy
lauraeddy / Liquid - replace comma separated list with html list.html
Created November 26, 2015 01:44
Liquid - replace comma separated list with html list
<ul class="nd-legend">{{legend | replace: ",", "</li><li>" | prepend: "<li>" | append: "</li>"}}</ul>
@lauraeddy
lauraeddy / Liquid - If field ==.liquid
Created November 26, 2015 01:44
Liquid - If field ==
{% if {{this.['Book or Enquire']}} == "Book" %}
<a href="#book-now" alt="Book Now" title="Book Now" class="btn btn-primary btn-block">Book</a>
{% else %}
<a href="#enquire" alt="Enquire" title="Enquire" class="btn btn-primary btn-block">Enquire</a>
{% endif %}
@lauraeddy
lauraeddy / Webapp classification syntax
Created November 26, 2015 01:44
Webapp classification syntax
{module_webapps id="webappnameorid" filter="classified" itemid="Parent Category Name/Sub Category Name" collection="collection1" template=""}
@lauraeddy
lauraeddy / Liquid - if desktop or mobile.liquid
Created November 26, 2015 01:43
Liquid - if desktop or mobile
{% if {{globals.visitor.deviceClass}} == 'desktop' -%}desktop{% endif -%}{% if {{globals.visitor.deviceClass}} == 'phone' -%}mobile{% endif -%}
{% assign date1 = {{this.['Calendar - Start Year']}} | append: "-" %}
{% assign date2 = {this.['Calendar - Start Month']}} | append: "-" %}
{% assign date3 = {{this.['Calendar - Start Day']}} %}
{% assign fullDate = date1 | append: date2 | append: date3 %}
{{fullDate}} - full date<br/>
{{globals.site.dateNow | date: "yyyy-MM-dd"}} - date now
{% if globals.site.dateNow < fullDate %}
@lauraeddy
lauraeddy / Liquid - truncate
Created November 26, 2015 01:43
Liquid - truncate
{{'Sample text ' | truncate: 100, "..."}}
@lauraeddy
lauraeddy / Liquid - Collection.html
Created November 26, 2015 01:43
Liquid - Collection with custom param
<div class="section calendar">
<span id="book-course" class="anchored"></span>
<h2>Calendar</h2>
<div class="schedule-wrap">
<div class="header">
<div class="column column-location">Location</div>
<div class="column column-dates">Dates</div>
<div class="column column-book"></div>
</div>
<div class="course-schedule-wrap">
@lauraeddy
lauraeddy / Liquid - dynamic styled dropdown.css
Created November 26, 2015 01:43
Liquid - dynamic styled dropdown
.styled-select select {
background: transparent;
width: 200px;
padding: 0;
height: 55px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 0;
height: 55px;
@lauraeddy
lauraeddy / JS - if less than
Created November 26, 2015 01:41
JS - if less than # characters Use this for the description textarea or when the empty field one doesn't work
$('ul li').each(function() {
if ($(this).text().length < 3)
$(this).closest('.description').remove();
});
@lauraeddy
lauraeddy / Form - Confirm email address.html
Created November 26, 2015 01:40
Confirm email address field in form
<label for="EmailAddress2">Confirm Email Address <span class="req">*</span></label>
<input id="EmailAddress2" class="cat_textbox" name="EmailAddress2" maxlength="255"/>