When you have a web page with multiple authenticated DataPages, you can hide the unwanted login screens for each DataPage by including custom JavaScript and HTML code in the DataPages’ Authentication object.

  1. In your Caspio Bridge account, open the app that has the authenticated DataPages.
  2. In the application, click the Authentications tab on the sidebar menu.
  3. Edit the Authentication object used in the DataPages.
  4. Under Configure Authentication section, click the + (plus) icon in the upper right of the Elements panel and select Header & Footer.

  1. Add HTML code in the Header and Footer as follows:

For DataPages with Responsive option enabled:

  • In the Header, disable HTML Editor in the Advanced tab and add the following code:
    </header><div class="cbAuthBox"><header>
  • In the Footer, disable HTML Editor in the Advanced tab and add the following code:
    </footer></div><footer>

For DataPages with Responsive option disabled:

  • In the Header, disable HTML Editor in the Advanced tab and add the following code:
    <div class="cbAuthBox">
  • In the Footer, disable HTML Editor in the Advanced tab and add the following code:
    </div>

Note: All DataPages embedded in the same web page must be either responsive or non-responsive. Mixing both options will cause undesirable behavior.

  1. Click Save to save the changes.
  2. In your web page where you embedded the DataPages, add the following JavaScript before the Caspio Bridge deployment code.
    <script type="text/javascript">
    function hideDP() {
      const authForms = document.getElementsByClassName('cbAuthBox');
      Array.prototype.forEach.call(authForms, function (authForm, index) {
        if (index > 0) {                   // Skip the first DP
          authForm.style.display = 'none'; // and hide the rest
        }
      });
    }
    document.addEventListener('DataPageReady', hideDP);
    </script>

Note: This article uses external HTML, JavaScript, or third-party solutions to add functionality outside of Caspio Bridge’s standard feature set. These solutions are provided “as is” without warranty, support or guarantee. The code within this article is provided as a sample to assist you in the customization of your web applications. You may need a basic understanding of HTML and JavaScript to implement successfully.