Hi,
I seem to have some trouble with the renderWith function
I have a DataObject and I created a public function that renders some data into a template and then returns the HTML, so I can use it to insert it in the TinyMCE via a widget.
public function getEventBlock()
{
return $this->renderWith('Includes/EventBlock');
}
It works if I put the template in the mysite templates directory, but I like it to pull the template from the theme dir, so it will work with different themes.
I tried to use the full path the theme dir but that does not work
I tried this
public function getEventBlock()
{
$Template = new SSViewer();
$Template->setTemplateFile('themes/MyTheme/templates/Includes/EventBlock.ss');
return $this->renderWith($Template);
}
Any tips on how I can do this would be appreciated.