This is EXACTLY the issue I'm trying to resolve (actually I've been trying for a couple of weeks)... I thought I was the only one having this problem!
I'm trying to add an editable sidebar to my site. I"m using the following Page.php which validates fine. However when I load it I get the same issue as you had. I've tried to re-key to remove any extra spaces -- now it crashes out my DB rebuild at SiteTree (Gah!). Frankly it's giving me the sh*ts -- SilverStripe is a great package but I'm a designer who can code -- not a developer. Plus while I can find my way around and cut and paste code, I can't write php functions from scratch...
So tell me -- which 'opening' and 'closing' tags are you referring to? The <?php and ?> tags? Or is it a spacing issue within?
Must you have a space before a {?
Do you not have a space before a (?
Can you see any issues with the attached?
Any advice appreciated...
<?php
class Page extends SiteTree {
public static $db = array(
'SidebarHTML' => 'HTMLText'
);
public static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields = addFieldToTab("Root.Sidebar",new HTMLEditorField("SidebarHTML"));
return $fields;
}
}
class Page_Controller extends ContentController {
public static $allowed_actions = array(
);
public function init(); {
parent::init();
}
}