This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

cms:onGetPageContent event

Triggered by Cms_Page
Author LemonStand eCommerce Inc.

Event handler signature

public array event_onGetPageContent(array $data)
$data array specifies a list of input parameters.
{return} array returns an array containing the content element.
Allows to programmatically modify a page content. The event handler should accepts an array of parameters with the following keys: The event handler should return an array with at least a single element content containing the updated content.
public function subscribeEvents() 
{
  Backend::$events->addEvent('cms:onGetPageContent', $this, 'get_page_content');
}

public function get_page_content($data) 
{
  // Replace parts of the page content
  $data['content'] = str_replace('NAME', 'OUR STORE NAME', $data['content']);

  // Add to the page content
  if($data['file_based'])
    $data['content'] .= '<br>CMS page file: '.$data['path'];

  $data['content'] .= '<br>CMS page URL: '.$data['url'];

  return $data;
}