Skip to content

Instantly share code, notes, and snippets.

View NickDeckerDevs's full-sized avatar

nicholas decker NickDeckerDevs

View GitHub Profile
@NickDeckerDevs
NickDeckerDevs / mega-menu.html
Last active July 24, 2018 19:31
Mega menu options in hubspot - example - not working code
<header>
<nav>
{% menu id="{{ module.main_menu }}", no_wrapper=True %}
</nav>
<div id="how-we-do-it" style="display: none;">
{% menu id="{{ module.how_we_do_it }}", no_wrapper=True %}
</div>
</header>
<script>
function megaMenuSetup() {
@NickDeckerDevs
NickDeckerDevs / gulpfile.js
Created July 25, 2018 10:58
Gulp file used for compiling SCSS into css. scss/dm2modules folder will compile to a single CSS file (/css/dm2modules/). Other folders will compile to a css/main.css. Gulp copies the current CSS file you are saving into your clipboard so you can paste your item into your live file without needing to open file and copy!
/*
install instructions:
npm init -y
npm install gulp gulp-sass gulp-rename gulp-plumber gulp-notify gulp-postcss autoprefixer fs copy-paste gulp-cached
folder setup:
html/ // i like working on my code in my editor so I have this
scripts/ // i like working on my code in my editor so I have this
gulpfile.js // this file
@NickDeckerDevs
NickDeckerDevs / .htaccess
Last active July 27, 2018 21:16
.htaccess addition to allow cross origin requests
# I advise using option 1 or two and only copying over the comments from where the option starts to the end of the </IfModule> tag
# To understand what is going on here is the documentation that I read to get this to work: https://httpd.apache.org/docs/2.4/mod/mod_headers.html
# Option 1
# This is where you add your hubspot domain. If you are importing your wordpress templates into multiple domains, see option 2.
#
# Replace https://dev.domain.com below with the domain that HubSpot is on. If you are currently working on a dev domain
# or some sort of staging server, you will need to change the domain to what you see in the URL at the top when previewing.
#
@NickDeckerDevs
NickDeckerDevs / post-7446.php
Last active July 27, 2018 21:33
Example menu template file for WordPress
<!-- please note this gist keeps reverting to 8 tabs and is really wasting my life, sorry for the screwed up tabbing -->
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
@NickDeckerDevs
NickDeckerDevs / site_header.html
Created July 27, 2018 21:38
Example header file
<header>
<div class="logo">
<img src="/images/logo.png" alt="Company X Logo">
</div>
<div id="js-insert-primary-menu"></div>
</header>
@NickDeckerDevs
NickDeckerDevs / site.js
Created July 27, 2018 21:52
example jQuery to contact our wordpress site and bring in our menu into our hubspot template
// I place this inside window.load so that the page gets moving and then the header gets brought in.
// you can change the cache to true
// you can do a lot more with this. Once you get a working version of this you will begin to think about
// all the ways you can play with this
$(window).load(function() {
$.ajax({
type : 'GET',
url : 'http://www.domain.com/primary-menu', // make sure this is the url of your menu page you created
dataType : 'html',
cache: 'false',
@NickDeckerDevs
NickDeckerDevs / millerwelidingform.js
Created August 10, 2018 20:01
miller welidng form stuff
function count(answer) {
var count = 0;
$('#lro-quiz-1 input[type="radio"]').each(function() {
if ($(this).is(':checked') && $(this).val() == answer) {
count = count + 1;
}
});
return count;
}
$('.question input[type="radio"]').on('change', function() {
@NickDeckerDevs
NickDeckerDevs / multiple_lcoations_email.html
Created August 10, 2018 20:35
hubspot email using multiple locations on a contact property value
{% if widget_data.location.value == "zieglerville-perkiomenville" %}
Little’s of Zieglerville/Perkiomenville<br>
3 Little Road<br>
Perkiomenville, PA 18074<br>
<img border="0" src="http://cdn2.hubspot.net/hubfs/1919990/Images/icons/phone.png" alt="Phone " style="border:0;"><a style="color: #fff;" href="tel:610-287-9643">610-287-9643</a>
{% elif widget_data.location.value == "hatboro" %}
Little’s of Hatboro<br>
335 S. York Road<br>
Hatboro, PA 19040<br>
<img border="0" src="http://cdn2.hubspot.net/hubfs/1919990/Images/icons/phone.png" alt="Phone " style="border:0;"><a style="color: #fff;" href="tel:610-873-2001">610-873-2001</a>
@NickDeckerDevs
NickDeckerDevs / slider.hs.html
Created August 14, 2018 16:17
hubspot slider
<!-- example slider group https://imgur.com/a/HHVbRZF -->
<div class="row-fluid">
<div class="max-width-container">
<div class="row-fluid">
<div class="cd-testimonials-wrapper cd-container flexslider span12">
<ul class="cd-testimonials slides">
{% for item in module.slider %}
<li class="cd-testimonials-item slide"{# style="background-image: url({{ item.image.src }});"#}>
<img src="{{ item.image.src }}" alt="{{ item.image.alt }}" width="{{ item.image.width }}" height="{{ item.image.height }}">
<div class="testimonial-content">
@NickDeckerDevs
NickDeckerDevs / link.txt
Created August 15, 2018 20:46
inbound app instructions