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.

Widgets /

Discuss SilverStripe Widgets.

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

Multiple Themes For Widgets

Go to End

2 Posts   812 Views


Community Member, 15 Posts

29 June 2011 at 11:22pm

Edited: 29/06/2011 11:25pm

Hi there,

I'm new to Silverstripe but am loving it so far. I have created a widget for pulling in Social Media which is working great. But I am working on a site which has a twitter feed and a facebook feed. Both have different HTML and CSS.

So I was wondering if I can dictate which theme the Widget should use rather than just using the default one?

Hope that makes sense.


For more context here is the function I'm using the Page Controller to render the Twitter feed:

     public function TwitterStream() {
     	$widget = new SocialPulseWidget();
     	$widget->WidgetTitle = 'Our Tweets';
     	$widget->addFeed('twitter', array('name' => 'prbloke', 'links' => true));
     	return $widget->renderWith('WidgetHolder');


Community Member, 15 Posts

30 June 2011 at 1:29am

Actually! I figured out how to do it!

You can create a tempalte file in /themes/{theme_name}/templates/layout and call it in renderWith.

So for example: I have create a file in the right folder and now I just use:

return $widget->renderWith('TwitterStream');