W1siziisijiwmtgvmdyvmjavmtavndevntcvnzgvd2fsbghhdmvultq5odmzns5qcgcixsxbinailcj0ahvtyiisijiwmdb4nziwxhuwmdnjil1d

NowSignage for Websites Guide

Embedding the code

The code provided when you click the "Embed" button on each 'NowSignage for Websites' card can be directly placed inside the HTML markup of your website.

The code is composed of two parts, the first is a "script tag", which looks similar to this:

<script src="https://cdn.nowsignage.com/for-websites/nowsignage-for-websites.min.js" charset="utf-8"></script>

This will grab a copy of our widget's code to run on your site, this only needs to be placed in the webpage once, it can fit anywhere, but for performance reasons it's usually placed before the </body> tag, or within the <head> and </head> tags.

The second part of our embed code is a description of how to setup your selected 'NowSignage for Websites' configuration. That line looks similar to this:

<div class="nowsignage-for-web" data-api="f9727fd757bca10eb289cafe7fed0d9ce" data-scoop="customer-comments" async>

The code downloaded from the script tag will look for these "div tags" to construct the widget, place this div tag in a part of the page you want our widget to display.


jQuery Plugin API

We offer a limited API for performing operations on the widget once it has been loaded on a page, and where that page contains the jQuery library.

All you need to do is call NowSignage from the $(document).ready() function:

$(document).ready(function() {
    // Call the `reflow` function on all available widgets
    $(".nowsignage-for-web").nowsignage("reflow");
});

All functions return a reference to the parent widget element, allowing the developer to chain function calls.

List of available functions

  • reflow: Forces the layout engine to recalculate the positions of all items on the widget.

    $(".nowsignage-for-web").nowsignage("reflow");
    ‚Äč
  • loadMore: Loads the next page of results into the widget, simulating a user click on the "Load More" button
    // Get the next page of results for all widgets:
    $(".nowsignage-for-web").nowsignage("loadMore");

  • setCTA: Changes the call-to-action text and URL.
    // Each item CTA will say "Follow Us" and link to NowSignage.com
    $(".nowsignage-for-web").nowsignage("setCTA", {text: "Follow Us", url: "https://nowsignage.com"});

  • setItemsPerPage: Controls how many items will be shown on first load, and when the user clicks "Load More"
    // Loads 12 items per page
    $(".nowsignage-for-web").nowsignage("setItemsPerPage", 12);