Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joe-dempsey's full-sized avatar

joe dempsey joe-dempsey

View GitHub Profile
/* ADD CLASS .flexbox-container TO PARENT - JOB DONE */
.flexbox-container {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-box-align: center;
{% comment %}
use the following to create a menu in Shopify
in this case we are assigning the menu with handle mobi_nav
{% endcomment %}
<ul class="nav">
{% for link in linklists.mobi_nav.links %}
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
{% comment %}let's build a list of collections based on a menu of collections.{% endcomment %}
{% comment %}this can be added to a page or collection - I'm assuming collection.{% endcomment %}
{% comment %}to start you need a menu which contains a list of links to collections.{% endcomment %}
{% comment %}this is a barebones version - which is supposed to be pulled into a theme so edit grid/loop etc as required{% endcomment %}
{% comment %}for custom shopify theme development email design at liquid dot gallery {% endcomment %}
{% comment %} our menu of collections has the handle "in-wild" {% endcomment %}
{% assign mastercollection = collection %} {% comment %}don't need this if using a page - use it to escape the for loop and reassign original collection.{% endcomment %}
<!-- here there's a simple example wwith a radio with field id features_website - 2 options -->
<?php $var = get_field('features_website'); ?>
<?php if( $var == 'web' ){ ?>
<p>It's a website...</p>
<?php } else if( $var == 'ecommerce' ){ ?>
AddType x-httpd-php54 .php
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://www.olddomain.com/$1 [L,R=301,NC]
RedirectMatch 301 ^(.*)$ http://newdomain.com/
@joe-dempsey
joe-dempsey / shopify email variables based on shipping method title
Last active December 20, 2016 15:12
shopify email variables based on shipping method title
<!-- variable (shipping title downcased) -->
{% capture shipping_title_downcased %}{{ shipping_method.title | downcase }}{% endcapture %}
<!-- logic -->
<!-- if the order shipping method title downcased contains the word collection -->
{% if shipping_title_downcased contains "collection" %}
<h1>You can collect your products from our stores 9-5 on weekdays</h1>
@joe-dempsey
joe-dempsey / shopify_sidebar_filters.liquid
Created April 11, 2017 10:24
Shopify sidebar filters
{% comment %} let's buid a sidebar collection navi menu in Shopify {% endcomment %}
{% comment %} note - we use this - https://semantic-ui.com/introduction/getting-started.html {% endcomment %}
{% comment %} initiate plugin via footer and load assets in header {% endcomment %}
{{ 'semantic.min.css' | asset_url | script_tag }}
{{ 'jquery.min.js' | asset_url | script_tag }}
{{ 'jquery.min.js' | asset_url | script_tag }}
{% comment %} links should be collections and submenus must exist {% endcomment %}
@joe-dempsey
joe-dempsey / count_in_liquid.liquid
Created April 21, 2017 12:27
How to count in Liquid for Shopify
{% assign counter = 0 %}
{% for something in somethings %}
{% assign counter = counter | plus: 1 %}
{% endfor %}
{{ counter }}