public function execute()
{
parent::execute();
$this->loadData();
$widgetTemplatesPath = FRONTEND_MODULES_PATH . '/Pages/Layout/Widgets';
// check if the given template exists
try {
$template = FrontendTheme::getPath($widgetTemplatesPath . '/' . $this->data['template']);
} catch (FrontendException $e) {
// template does not exist; assume subpages_default.html.twig
$template = FrontendTheme::getPath($widgetTemplatesPath . '/PreviousNextNavigation.html.twig');
}
$this->loadTemplate($template);
$this->parse();
}