'; promoHtml += ''; $("#promo03Message").html(promoHtml); $("#home-promo-wrapper, #home-promo-below-navigation").show(); // exit the loop return false; } }); // PROMO UNDER NAVIGATION $("#promo04Container .content-data").each(function() { console.log("promo under nav function"); // Collect date and content data var startDate = moment.tz($(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz($(this).find(".endDate:first").val(), "America/New_York"); // If the current date is between the start and end date as you loop // alert(startDate + ' ' + endDate + ' ' + curDate); if (startDate <= curDate && curDate < endDate) { console.log("promo under nav entering info"); var imgSrc = $(this).find(".imgSrc:first").val(); var imgMobileSrc = $(this).find(".mobileImgSrc:first").val(); var promoLink = $(this).find(".promoLink:first").val(); var promoText= $(this).find(".promoText:first").val(); var promoHtml = ''; // Set the content based on what was collected above promoHtml += ''; promoHtml += ''; $("#promo04Message").html(promoHtml); $("#home-promo-wrapper, #home-promo-below-navigation").show(); // exit the loop return false; } }); // FEATURED CATEGORY AND SHOP BY CATEGORY SECTION FUNCTIONS function categorySetup(thisSearch, slotId, subCat, featuredSection) { // Collect date and content data var startDate = moment.tz(thisSearch.find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz(thisSearch.find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var featured01html = ''; thisSearch.find(subCat).each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var infoText = $(this).find(".featuredname:first").val(); var hrefUrl = $(this).find(".featuredlink:first").val(); featured01html += '
'; ++sectionCounter; }); $(slotId).html(featured01html); // exit the loop return false; } } // FEATURED CATEGORY AND SHOP BY CATEGORY SECTION FUNCTIONS function shopBySetup(thisSearch, slotId, subCat, featuredSection) { // Collect date and content data var startDate = moment.tz(thisSearch.find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz(thisSearch.find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var featured01html = ''; featured01html += '
'; thisSearch.find(subCat).each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var infoText = $(this).find(".featuredname:first").val(); var hrefUrl = $(this).find(".featuredlink:first").val(); featured01html += '
'; ++herocounter; }); //ADD SLIDES TO DESKTOP SLIDER $(".homepage-slider").html(herohtml); //ADD SLIDES TO MOBILE SLIDER $(".mobile-home-slider").html(mobilehtml); //INITIATE SLIDER $('.homepage-slider, .mobile-home-slider').slick({ infinite: true, autoplay: true, autoplaySpeed: 5000, prevArrow: '', nextArrow: '' }); $('.mobile-home-slider').addClass('activated'); // EXIT THE LOOP return false; } }); //HERO SLIDE FUNCTION CLOSE } //new homepage layout if( $("#homepage-top-section") ){ $("#homepage-top-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileContent = ''; $(this).find(".hp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); sectionContent += '
'; }); $( '.hp-top-section').html(sectionContent); $( '.newHomePageMobile').html(mobileContent); // exit the loop return false; } }); } if( $("#homepage-middle-section") ){ $("#homepage-middle-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".hp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); // sectionContent += ''; // mobileContent += ''; sectionContent += ''; mobileSection += ''; }); $( '.hp-middle-section').html(sectionContent); $( '.hp-mobile-middle-section').html(mobileSection); // exit the loop return false; } }); } if( $("#homepage-middle-two-section") ){ $("#homepage-middle-two-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".hp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); // sectionContent += ''; // mobileContent += ''; sectionContent += ''; mobileSection += ''; }); $( '.hp-middle-two-section').html(sectionContent); $( '.hp-mobile-middle-two-section').html(mobileSection); // exit the loop return false; } }); } if( $("#homepage-bottom-section") ){ $("#homepage-bottom-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".hp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); var logo = $(this).find(".logo").val(); var cta = $(this).find(".cta").val(); var bgColor = $(this).find(".bgColor").val(); // sectionContent += ''; // mobileContent += ''; sectionContent += ''; sectionContent += '
'; }); $( '.hp-bottom-section').html(sectionContent); $( '.hp-mobile-bottom-section').html(mobileSection); // exit the loop return false; } }); } if( $("#hp-flip-bottom-section") ){ $("#hp-flip-bottom-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".hp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var price = $(this).find(".price:first").val(); var bodycopy = $(this).find(".bodycopy").val(); var bgColor = $(this).find(".bgColor").val(); // sectionContent += ''; // mobileContent += ''; sectionContent += ''; sectionContent += '
'; }); $( '.hp-flip-bottom-section').html(sectionContent); $( '.hp-flip-mobile-bottom-section').html(mobileSection); // exit the loop return false; } }); } if( $("#category-top-section") ){ $("#category-top-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileContent = ''; $(this).find(".ct-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); sectionContent += ''; mobileContent += ''; }); $( '.categoryHero').html(sectionContent); $( '.catMobileWrapper').html(mobileContent); // exit the loop return false; } }); } if( $("#category-bottom-section") ){ $("#category-bottom-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var sectionCounter = 1; $(this).find(".ct-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); if (sectionCounter == 4 || sectionCounter == 5 || sectionCounter == 6) { sectionContent += '
'; } ++sectionCounter; }); $( '.categoryBottomWrapperBody').html(sectionContent); // exit the loop return false; } }); } if( $("#category-third-section") ){ $("#category-third-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var sectionCounter = 1; $(this).find(".ct-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); if (sectionCounter == 4 || sectionCounter == 5 || sectionCounter == 6) { sectionContent += '
'; } ++sectionCounter; }); $( '.categoryThirdWrapperBody').html(sectionContent); // exit the loop return false; } }); } //influence page if( $("#inspiration-top-section") ){ $("#inspiration-top-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".insp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy:first").val(); var logo = $(this).find(".logo:first").val(); var cta = $(this).find(".cta:first").val(); var bgColor = $(this).find(".bgColor:first").val(); sectionContent += '
'; }); $( '.inspiration-slider1').html(sectionContent); $( '.inspiration-mobile-1').html(mobileSection); // exit the loop return false; } }); } if( $("#inspiration-second-section") ){ $("#inspiration-second-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var sectionCounter = 1; $(this).find(".insp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); sectionContent += '
'; }); $( '.inspiration-slider2').html(sectionContent); // exit the loop return false; } }); } if( $("#inspiration-third-section") ){ $("#inspiration-third-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".insp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); var logo = $(this).find(".logo").val(); var cta = $(this).find(".cta").val(); var bgColor = $(this).find(".bgColor:first").val(); sectionContent += '
'; }); $( '.inspiration-slider3').html(sectionContent); $( '.inspiration-mobile-2').html(mobileSection); // exit the loop return false; } }); } if( $("#inspiration-fourth-section") ){ $("#inspiration-fourth-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var sectionCounter = 1; $(this).find(".insp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); sectionContent += '
' + header + '
' + bodycopy + '
'; }); $( '.inspiration-slider4').html(sectionContent); // exit the loop return false; } }); } if( $("#inspiration-fifth-section") ){ $("#inspiration-fifth-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); var sectionCounter = 1; // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".insp-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy").val(); var logo = $(this).find(".logo").val(); var cta = $(this).find(".cta").val(); sectionContent += '
'; }); $( '.inspiration-slider5').html(sectionContent); $( '.inspiration-mobile-3').html(mobileSection); // exit the loop return false; } }); } if( $("#parent-top-section") ){ $("#parent-top-section .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".ct-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var link = $(this).find(".link:first").val(); sectionContent += ''; mobileSection += ''; }); $( '.parentCategoryBanner').html(sectionContent); $( '.parentCategoryBannerMobile').html(mobileSection); // exit the loop return false; } }); } if( $("#parent-top-section-box") ){ $("#parent-top-section-box .content-data").each(function() { // Collect date and content data var startDate = moment.tz( $(this).find(".startDate:first").val(), "America/New_York"); var endDate = moment.tz( $(this).find(".endDate:first").val(), "America/New_York"); // If the current date is between the start and end date as you loop if (startDate <= curDate && curDate < endDate) { // Set the content based on what was collected above var sectionContent = ''; var mobileSection = ''; $(this).find(".ct-section").each(function() { var imgSrc = $(this).find(".imgSrc:first").val(); var mobileImg = $(this).find(".mobileSrc:first").val(); var imageAlt = $(this).find(".imageAlt:first").val(); var header = $(this).find(".header:first").val(); var bodycopy = $(this).find(".bodycopy:first").val(); var logo = $(this).find(".logo:first").val(); var bgColor = $(this).find(".bgColor:first").val(); sectionContent += '