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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Widgets /

Discuss SilverStripe Widgets.

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

SearchForm in a widget?

Go to End



Community Member, 1 Post

18 April 2011 at 10:46pm

Hi all,

I'm trying to add a blog search tool using some code which I've found in one of my old site implementations (I've no idea where I found this code or if it ever worked?!).

I have the following files..



 * A simple widget that just shows a search box
 * @package blog
class SearchWidget extends Widget {
	static $title = 'Search';
	static $cmsTitle = 'Blog Search';
	static $description = 'Shows a search option on the sidebar. This feature uses the standard site search module, so ensure that all other pages have "Show in search?" disabled unless you wish for those pages to feature in the search results.';

	 * Return an absolute URL based on the BlogHolder
	 * that this widget is located on.
	 * @return string




The widget is happily available with the Blog module of the CMS, but after nudging around in various directions, I've just hit a wall and can't get it to run.
I'm running SS v2.4.5 and I've enabled search with FulltextSearchable::enable();
I can also call $SearchForm from within another template eg. succesfully.

Anyone got any ideas? I'm stumped!

Thanks in advance...