NOTE: This component is no longer being sold on current showcase sites, because the alert has been moved to a modal and the potential for multiple modals would be bad UX.
This component allows the client to put a modal on their sites that shows up when the site is opened for the first time. It’s meant as a “tour” or “welcome to our new site” sort of thing. On close, it sets a cookie for a year. It is generally manually removed with a post-launch case after a while, because it doesn’t make sense to have a “welcome to our new site” modal when the new site’s been there for a long time.
JSON Files
package.json- For the homepage “featured rates” section, all the necessary pieces in the mustache are controlled by thepackage.jsonfile. Make sure that yourcomponentTourModalvariable in thepackage.jsonfile is set totrueif things aren’t working!-make.json- Since this is a component that adds content areas to the homepage, make sure to rungulp make-everything, grab the list of content areas from thetemplates.jsonthat is generated, and paste them into the home template in your-make.jsonfile.
Mustache Files
src > templates > _partials > _tour-modal.mustache- The main file for the component.src > templates > home.mustache- Where the modal is included. Note that it’s not included on any subpages by default; it only appears on the homepage. This piece will automatically be un-commented if thecomponentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually un-comment this.
Script
src > scripts > banno-functions.jsUncomment the
banno.site.displayTour();function at the top, this calls the function that is defined lower down. This piece will automatically be un-commented if thecomponentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually un-comment this.Function to display the modal, and ensures it only opens when it has content. This piece will automatically be un-commented if the
componentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually un-comment this.
src > scripts > script.jsInside the IF function at the top, to make sure the modal opens when the editor is opened. This piece will automatically be un-commented if the
componentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually un-comment this.Inside the ELSE function at the top, to deal with what happens when the modal is closed. This piece will automatically be un-commented if the
componentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually un-comment this.
src > scripts > sliders.js- There is a slider inside the modal. This piece will automatically be un-commented if thecomponentTourModalin your package.json is set totrue. If you are working with older showcase files, you may need to manually uncomment this. Make sure to uncomment both the IF and the ELSE sliders–there are two, one for within the CMS and one for the published page.
Styling
src > scss > themes > _general.scss- Styles for this component that are common across all themes.src > scss > themes > [yourtheme].scss- Styles that are specific to the theme you’re using.
Example Sites
This has not been put on any sites yet, but feel free to edit to include one of your sites as an example!