Broadcast

What is a Broadcast?

Broadcasts are dynamic areas capable of holding multiple other blocks in rotation, for the purpose of internal advertising. These broadcast areas can be added via the editor as Broadcast Blocks, or via code.

With Broadcasts, you can show a different block in your marketing or campaign rotation on each page view, maximising exposure without cluttering your site up.

This not only easily allows you to rotate through more than one block at a time, but also to distribute any new block to many different broadcasting areas in one go.

Terminology

  • A Broadcast is a dynamic block that rotates through a collection of nested Global Blocks (blocks that can be used on more than one page). It is a standalone container.
  • A Broadcast Block is a block-representation of an existing Broadcast, very similar to how Global blocks work.

Using Broadcast in GUI

Using Broadcast in PHP templates

In some cases, you might need to display a Broadcast in a PHP template. So Accelerate provides a handy helper function to help you do that. You can use the following function:

if ( function_exists( 'Altis\\Accelerate\\Broadcast\\render' ) ) {
  echo Altis\\Accelerate\\Broadcast\\render( $broadcast_id = 120, $client_id = 'footer-hero-broadcast' );`
}
  • $broadcast_id is the ID of the Broadcast to target.
  • $client_id is an optional unique identifier for that instance of the Broadcast, for later Analytics analysis and reporting.