How to add Content Preview

Last updated 05/05/2023

Before adding content preview make sure you have added the initialization script tag.

The content preview feature allows you to limit access to specific web pages on your website to visitors that have authenticated. When the user goes to the page, the content is partially hidden by the content preview sign in section.

You can also customize the text content at the bottom to meet your unique business needs. Once signed in, users can see the page content.

This guide explains how to add Content preview to any page on your site, and how to configure the text content you want it to display.

Step 1

Find the initialization script you have added to your webpage (see initialization script if you have not added it already)


Step 2

In the initialization script, find the line:

BreadButter.configure({app_id: "[APP_ID]"});

Step 3

Add the following line under BreadButter.configure();

BreadButter.ui.contentPreview({
    restricted_links: ["CONTENT_PREVIEW_PAGE"],
    locale: {
       POPUP: {
            TEXT_3: 'TEXT LINE 1',
            TEXT_3_2: 'TEXT LINE 1 EXPANDED',
            MORE: 'EXPAND LABEL',
        }
    },
});

Step 4

Replace CONTENT_PREVIEW_PAGE with the page (or pages) you want to apply content preview to. Enter the URL like this:

["/work"]

Or like this for multiple pages:

["/work/project-1", "/work/project-2"]

You can also user a wildcard * to block all URLs under /work/, like /work/projects, but not including /work:

["/work/*"]


Step 5

The 3 remaining fields under POPUP allow you to customize the text that appears below the sign in options.

  • Replace TEXT LINE 1 with a short line of text you'd like to display to your users. This could explain why its important or valuable for the user to complete the sign in process.
  • Replace TEXT LINE 1 EXPANDED with a more detailed or longer explanation of the value of signing in. This content will replace TEXT_3 when a user clicks the "MORE" option.
  • Replace EXPAND LABEL with the label for the expand link. We recommend setting this to "more>>".

Step 6

You should now see the content preview tool appear on the specified page, after the specified time period.