SilverStripe 'None of these templates can be found in theme 'default'

728 views Asked by At

I have a widget which has two templates. EligibilityWidget.ss and EligibilityWidget_ShortForm.ss .

I am running this code

public function init() {
    $cookie = (Cookie::get('__utmz'));

    if (isset($cookie)) {
        return $this->renderWith('EligibilityWidget_ShortForm');
    } else {
        return $this->renderWith('EligibilityWidget');
    }
}

This should identify if the cookie exists and render the information with the correct template. However, when I run this I get the error message:

[User Warning] None of these templates can be found in theme 'default': Widget.ss, DataObject.ss, ViewableData.ss, Object.ss

I have also tried changing a line of code to

return $this->renderWith(array('EligibilityWidget_ShortForm', 'Widget'));

However this also returned the same error. Any help would be appreciated, thank you.

0

There are 0 answers