Content Callback Functions

Prev Next

The Syndi framework supports both "Has Content" and "No Content" callback functions.

Example Scenario

Content has to live in a tab on the website and you want to show/hide that tab depending on if content is present.

Callback Functions are placeholders for website owners to provide methods and/or functions which can be initiated by Syndi when one of two conditions are met:

  • Syndigo has content available for the page
  • Syndigo does not have content available for the page

Below is an example template for a website which has both "Has Content" and "No Content" callback functions:

(function () {​​​​
    window.SYNDI = window.SYNDI || []; 
    window.SYNDI.push({​​​​
        "contentCallback": function (hasContent) {​​​​
            if (hasContent)  {​​​​
                yourHasContentCallbackFunction(); //replace with your own function
            }​​​​
            else {​​​​
                yourHasNoContentCallbackFunction(); //replace with your own function
            }​​​​
        }​​​​
    }​​​​);
}​​​​());

where you replace "yourHasContentCallbackFunction" and "yourHasNoContentCallbackFunction" with the appropriate functional to take the desired action on your website.