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:onExtendTemplateModel event

Triggered by Cms_Template
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendTemplateModel(Cms_Template $layout, string $context)
$layout Cms_Template specifies the layout object to extend.
$context string specifies the execution context.
Allows to define new columns in the layout model. The event handler should accept two parameters - the layout object and the form execution context string. To add new columns to the layout model, call the define_column() method of the layout object. Before you add new columns to the model, you should add them to the database (the templates table).
public function subscribeEvents()
{
  Backend::$events->addEvent('cms:onExtendTemplateModel', $this, 'extend_template_model');
  Backend::$events->addEvent('cms:onExtendTemplateForm', $this, 'extend_template_form');
}

public function extend_template_model($template, $context)
{
  $template->define_column('x_extra_description', 'Extra description');
}

public function extend_template_form($template, $context)
{
  $template->add_form_field('x_extra_description');
}