Hopefully somebody can help me out here. I have a blog page which is currently showing two Widget panels in the sidebar. One is the default setting, the second is due to a modification I made to the page code to ensure that the widget panel appeared beneath the sidebar navigation panel in my template (as opposed to on top of my navigation template)...
So now, having generated a second Widget panel I set about disabling the first. I found a useful tutorial under http://doc.silverstripe.org/sapphire/en/topics/widgets which told me how to do this as follows:
--
But what if I have widgets on my blog currently??
If you currently have a blog installed, the widget fields are going to double up on those pages (as the blog extends the Page class). One way to fix this is to comment out line 30 in BlogHolder.php and remove the DB entry by running a /db/build.
** blog/code/BlogHolder.php **
<?php
class BlogHolder extends Page {
........
static $has_one = array(
// "SideBar" => "WidgetArea", COMMENT OUT
'Newsletter' => 'NewsletterType'
.......
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeFieldFromTab("Root.Content.Main","Content");
// $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar")); COMMENT OUT
........
Then you can use the Widget area you defined on Page.php
--
Yeah, right... First problem is the build of SilverStripe that I am using is obviously a later version. In the file BlogHolder.php does not extend the Page class, it extends the Blog tree. The code is completely different. And commenting out any mention of Sidebar in this file has no apparent effect on the page, even after running db/build
Am I working on the wrong file? Is there a more up-to-date method? Can anybody give me any pointers?
T.I.A...