Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » admin: blog has twice the number of widgets.

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1258 Views
  • raamklaza
    Avatar
    Community Member
    182 Posts

    admin: blog has twice the number of widgets. Link to this post

    In the blog i see the widgets double.

    I used the documentation of silverstripe to add widgets to all the normal pages, but now it's double for the blog page because it's already in their.

    How can i solve this? Where in the blog can i take this out?

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: admin: blog has twice the number of widgets. Link to this post

    In the admin section i mean

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: admin: blog has twice the number of widgets. Link to this post

    Hi,

    to remove the duplicate widgets in your blog you have to edit blog/code/BlogHolder.php like this:

    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.

    <?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

       ........

    (taken from here: SSWidgetsDoku )

    Cheers!

  • raamklaza
    Avatar
    Community Member
    182 Posts

    Re: admin: blog has twice the number of widgets. Link to this post

    Thnx maybe i should have read better :$

    1258 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.