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;
}