Popup Builder

  1. Overview
  2. Integration
  3. The Basics
  4. Content Width
  5. HTML Output (HTML Partials)
  6. Popup workspace
  7. Common settings
  8. Popup workspace layout
  9. Content area width
  10. Extended settings
  11. Custom layouts
  12. Custom styles (aka “Themes”)
  13. Custom styles
  14. A brief word about design modes
  15. The popup HTML
  16. Order of operations
  17. Starting from scratch
  18. Applying custom styles
  19. Deep-dive into CSS properties
  20. Custom layouts
  21. The layout HTML
  22. Changing the position of a layout

Overview

This version of the BEE editor aims to provide the foundations needed to build a delightful popup building experience.

Integration

Out-of-the-box, the setup, and configuration are the same as Email and Page Builder.  Loading Popup Builder with no additional settings will present the end-user with a beautifully designed popup and workspace to design their content.




beeConfig: {
  uid: 'CmsUserName', // [mandatory]
  container: 'bee-plugin-container', // [mandatory]
  ...
}



However, the popup builder comes with an additional, robust set of configuration options to customize the workspace.  This allows the host application to build a workspace that matches their popup’s look and feel and the page where you will embed the popup.

For example, the host app can customize…

  • The popup workspace background to view how the popup will look “in context” on the destination page.
  • The theme and position of the popup for both desktop and mobile design modes.

In the following sections, we will look at how to customize the workspace, starting with the common settings and working up to a full custom layout.

The Basics

Let’s start by looking at some of the differences between Page Builder and Popup Builder.

Content Width

In Email and Page Builder, the content area width is saved in the template. For example, if you start with an empty template, a default width that works for most scenarios is chosen, but the designer can use the message width slider to adjust it. If you start with an existing template, the content width was chosen by the template’s designer using the message width slider in the BEE Plugin’s Settings tab.

With Popup Builder, the same template may have multiple contexts, and each context will likely have specific size requirements. For example, an exit-intent popup may have a max-width of 600px on a desktop with a classical layout centered on the screen. The host app may display the same template on mobile in the bar style docked at the bottom of the screen with a restricted width of 300px.

Since the content area’s width is tightly coupled to the context and layout, no one size fits all width is saved in the template. Instead, the host app will specify the width settings when the editor loads, based on the context in which you will use the template.  You’ll find an example in the common settings section below.

Popup Builder MVP does not support fluid 100% width content. This is due to the internal dependencies on a fixed width, such as Image and Carousel Blocks.  A responsive option with 100% width is being scoped.

HTML Output (HTML Partials)

In Email and Page Builder, the BEE Plugin HTML parser service converts your template into an HTML document customized for email or pages, respectively. However, the Popup Builder will not return a full HTML page because the final destination is up to the host application. BEE Plugin Popup Builder doesn’t provide the scripts to control the popup’s behavior, such as opening and closing. Rather, Popup Builder provides the HTML “partials” to embed within your popup’s content area or body.

The HTML partial will come with all the CSS required to look as it did in the preview mode. The parser service will wrap the content with a special container that will clear all the host application styles and prevent style conflicts. The HTML output is designed to be embeddable into any popup framework or application and still render the way it appeared in the editor.

Popup workspace

Now that we covered the basic differences between Popup Builder and our other plugins let’s talk about what you should expect when the editor starts. 

As mentioned above in the Getting Started section, you will receive a ready-to-go design experience if no settings are provided.  The default layout is a classic centered modal with a fixed width.

 

If the default popup style and layout suit your needs, then you are all set to start designing! You can load the editor without any additional configuration and use the same standard controls and callbacks to access the HTML and JSON template.

What if you like most of the defaults but want to make some minor adjustments? We have you covered!

Common settings

Easily change the background to make the workspace look like the destination page where you’ll embed the popup.




beeConfig: {
  ...
  workspace: {
    popup: {
      backgroundImage: 'https://.../background.png',
      backgroundImageMobile: 'https://.../background.png',
      ...
    }
  }
}


If this option is not set, then we will provide a default skeleton layout.  It’s worth noting at this point that you can apply every setting for both desktop and mobile design modes. That means you can have a different background when editing in Mobile Design Mode. We’ll show you how later!

One of the most common needs is changing the popup’s position from the default-centered position to better match the end-user’s use case. Out-of-the-box, the Popup Builder comes with many of the most common popup layouts preconfigured. You can use any of the available presets “as is” or use them as starting points that you can fine-tune to your satisfaction.




beeConfig: {
  ...
  workspace: {
    popup: {
      layout: 'bar-top'
    }
  }
}


Here is a complete list of preset layouts:

table here to do

Content area width

As mentioned above, the content area’s width is tightly coupled to the layout, no one size fits all width is saved in the template. All Popup Builder preset layouts come with a default width, which you can override with the following configuration settings.




workspace: {
  popup: {
    contentWidth: 600,
    contentWidthMobile: 300
  }
}


Extended settings

What if the default styles and common settings aren’t enough? No worries! In the following sections, we will look at styling your popup to make it look and feel more like the one that you use in your application. We’ll start with some basic concepts and work our way to create a full custom popup workspace.

Custom layouts

We covered the layout set in the previous section. To recap, the layout determines the type of popup (e.g., a bar) and its location on the screen (e.g., bottom). Our research team looked into it, and it turns out, nearly all popups fall into one of the most popular layouts, which we’ve included as presets. But, when that’s not enough, the configuration option customLayout can be used to make minor adjustments to a preset layout or create an entirely new layout from scratch.

Here a preview of the configuration:



workspace: {
  popup: {
    customLayout: {
      ...
    },
  }
}

Custom styles (aka “Themes”)

A theme is simply a set of custom styles that give the popup its look and feel. Separate from your layout, BEE Popup Builder comes with two themes.  The first is our default theme that is loaded when no settings are specified.  We also provide an empty theme that has no styles, which you can use a blank canvas to create your own theme.  This is one of the most powerful features of Popup Builder, and we’ll be covering custom styles in depth below.

Here a preview of the configuration:




workspace: {
  popup: {
    customStyles: {
      ...
    },
  }
}


Custom styles

A brief word about design modes

The popup HTML

To understand the best way to apply your styles, let’s start by inspecting the underlying HTML structure so you can view where BEE will map your styles.

Popup HTML




  


Here is a quick break down of what each div does:

popup-container

This is where you will apply any styles related to how the popup looks, such as border radius, drop shadows, background colors, or padding.

popup-header

The header is sometimes used to add a close icon to a popup or display a title.

popup-content

The div that holds the editable content of the BEE Plugin.

popup-footer

You can use this div to show a traditional footer for your popup or to position some icons outside the popup container (e.g., a close button).

The above HTML structure is represented in your bee config as the following JSON object.




customStyles: {
  container: {},
  header: {},
  content: {},
  footer: {},
  overlay: {},
},   


Add styles to the JSON section that corresponds to the HTML element you want to style.

For example, if you want to apply styles to the div with id popup-container, then you would add the styles to the following JSON:




customStyles: {
  container: {
    ...styles,
  },
},   


We’ll go deeper into styling in the following sections.

Order of operations

You may be wondering at this point if you have to design an entire theme to get started.  Well, you can if you want to, but thanks to the order of operations, you don’t have to.  You can start with our default theme and pass in the styles that you want to override.  Any style you provide will take priority over any of the defaults.

Starting from scratch

We said that you could start from scratch if you want, and the easiest way to do that is by using our theme parameter.  This allows you to avoid overriding every default style and gives you more of an empty canvas to build your own theme.

Example:




beeConfig: {
  workspace: {
    popup: {
      theme: 'custom'
    }
  }
}


Applying custom styles

Now that you have seen what the HTML looks like and have some idea where to apply your styles let’s look at how you get your styles into the editor. The best way to show you is by example, so let’s get started with some common use cases!

Adding a border

Using the schema JSON above and your HTML structure knowledge, you probably guessed that the border is defined on the popup container. Here’s what that would look like:

Example:



workspace: {
  popup: {
    customStyles: {
      container: {
        border: '1px solid black'
      }   
    }
  }
}

Adding a drop shadow

Example:




workspace: {
  popup: {
    customStyles: {
      container: {
        boxShadow: '0 5px 15px rgba(0, 0, 0, 0.5)'
      }
    }
  }
}


Deep-dive into CSS properties

After looking at a couple of samples, you may notice these parameters are looking familiar. That’s because every layer of our schema maps to a layer of HTML with the same name AND can be styled with any valid CSS property.

Basically, CSS properties are the same as CSS used by web developers in style sheets, but instead of dashes to separate words, it uses a camel case.

Example:

The CSS property of the style box-shadow would be boxShadow.

Why not use CSS styles as defined by CSS3 specification directly? Well, simply put, CSS properties are better suited for JSON and can easily be shared with any FE application using the popular React framework.

Custom layouts

The layout HTML

The popup is positioned in the workspace using divs and CSS flexbox. We created a layout structure that mimics an actual HTML page to map your page’s styles to the workspace.

Layout HTML:




Overview

Here is a quick break down of what each div does:

HTML

We will apply the styles placed here to the document HTML tag.

body

We will apply the styles placed here to the HTML body tag

main

This is the main container div of the workspace.

popup-wrapper

The wrapper of the popup is used entirely for positioning the popup within the workspace main div.

Changing the position of a layout

Example:




workspace: {
  popup: {
    layout: 'classic-center',
    customLayout: {
       wrapper: {
        maxWidth: '700px'
      }  
    }
  }
}