This function returns the handlebars template. Overwriting the function is optional. If no custom implementation is specified, the content of the template.hbs file is loaded into the widgets directory.
Please note: The selection of the template should not depend on the data since it can not be guaranteed that the template will be updated when the data is updated.
Example:
public function getTemplate()
{
$customTemplatePath = $this->getWidgetFilePath('../shared_files/custom_widget.hbs');
if (file_exists($customTemplatePath)) {
return file_get_contents($customTemplatePath);
}
return parent::getTemplate();
}