Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Blog Error - SS 2.2.2 - Tried all blog versions


Go to End


25 Posts   13877 Views

Avatar
AndyWiltshireNZ

Community Member, 35 Posts

1 June 2008 at 8:22am

So I am trying to add widgets to all other pages by following the doc. But its not working.

The mysite/code/Page.php looks like this...

class Page extends SiteTree {
	static $db = array(
	);
    static $has_one = array(
	"Sidebar" => "WidgetArea",
    );
	
    function getCMSFields() {
	$fields = parent::getCMSFields();
	$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
	return $fields;
    }
}

But I find this a little confusing...

Then in your Template you need to call $SideBar whereever you want to render the widget
themes/myThemeName/templates/Includes/Sidebar.ss

$Sidebar

Ive tried adding $Sidebar in several places, and I have done the db/build, but its still not showing the sidebar. I did remove the sidebar from the blog too, as to avoid a double up as recommended.

Thanks in advance,

Andy

Avatar
(deleted)

Community Member, 473 Posts

1 June 2008 at 8:56am

How does the blog part of the theme you're using do it?

Just copy that.

Avatar
AndyWiltshireNZ

Community Member, 35 Posts

3 June 2008 at 11:46am

Edited: 03/06/2008 11:46am

Okey Dokey, thanks for all the help guys, Ive finally got it all 'mostly' working, besides the small bug with the security > members backend (http://www.silverstripe.com/site-builders-forum/flat/81598), you can view the site here: http://bombr.net

What I need now is a widget for the home page to display popular forum threads: http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/81722#post81722

Thanks for the assistance again, much appreciated!

Avatar
AndyWiltshireNZ

Community Member, 35 Posts

9 June 2008 at 6:22pm

Edited: 09/06/2008 6:22pm

Never did this solve this problem, but with a fresh install of SS 2.2.2, the Blog module current version and/or the daily build version, I get a blank page for the blog entries. I read that its potentially something to do with widgets or templates, but cannot figure out a solution. Ive tried every combination of versions of both SS and the Blog module, but it always seems to happen. I have dev mode enabled, but there are no errors outputed, so I don't even know where to start.

On one of my trial sites I managed to get it going, but I can't tell why, because I simply went through and installed all the main modules in one hit. Ive tried it with the default blackcandy template and various others with no success. I have also seen that others have had the same problem, but no solutions were offered.

(On a side not, how come this forum doesnt work with line breaks? Its kinda annoying how it groups all the text together... )

Avatar
Willr

Forum Moderator, 5523 Posts

9 June 2008 at 6:28pm

Do you get the blank page in dev mode? any errors in your apache / php logs

Avatar
AndyWiltshireNZ

Community Member, 35 Posts

9 June 2008 at 8:46pm

Edited: 09/06/2008 8:50pm

Im managing to get the following output if I refresh the page a few times:

Debug (line 118 of BBCodeParser.php): Congratulations, the SilverStripe blog module has been successfully installed. This blog entry can be safely deleted. You can configure aspects of your blog (such as the widgets displayed in the sidebar) in <a href="admin">the CMS</a>.

This is a fresh install of SS 2.2.2 with the standard blog module version.
I replaced the BBCode parsers with the Daily build versions and it seems to have cleared up that debug line, but...
Its very strange, if I navigate straight to the blog holder or blog entry I get a blank page, but if I refresh the page 2-3 times it eventually loads...

Avatar
rjmackay

Community Member, 11 Posts

10 September 2008 at 1:50pm

Hey,
I've been having similar issues to this - always getting a blank page for the blog pages.
I narrowed the problem down to the BBCodeParser.
Basically something goes wrong if you have the BBCodeParser installed as a Pear library - maybe php includes the wrong one?

Anyway I remove the BBCodeParser.php and BBCodeParser directory from your PEAR include directory it starts working fine.
I'm still looking for a slightly better work around - will post if I find one (and I'll log a bug too)

Robbie

Avatar
rjmackay

Community Member, 11 Posts

10 September 2008 at 3:48pm

Ok so the problem lies in the code to add filters:
line 216 of sapphire/parsers/HTML/HTMLBBCodeParser.php:
@include_once 'BBCodeParser/Filter/'.$filter.'.php';

The @ silences the errors which is a problem in itself.

Then when the filter file is include (eg Basic.php)
line 31: require_once 'HTML/BBCodeParser/Filter.php';

This is meant to include sapphire/parsers/HTML/BBCodeParser/Filter.php but actually includes from the pear include directory - since that comes first in my include path.

So the solution is to change the following line in sapphire/_config.php:
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

to:
set_include_path(str_replace('.' . PATH_SEPARATOR, '.' . PATH_SEPARATOR . $path . PATH_SEPARATOR, get_include_path()));

Thus putting the parsers directory ahead of the pear dir in the php include path. Or alternatively you could change the individual filter files to use relative paths for includes.

PATCH IS ATTACHED