PHPackages                             grandcreation/silverstripe-widgets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. grandcreation/silverstripe-widgets

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

grandcreation/silverstripe-widgets
==================================

Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.

2.0.1(8y ago)035BSD-3-ClausePHP

Since May 8Pushed 7y agoCompare

[ Source](https://github.com/grandcreation/silverstripe-widgets)[ Packagist](https://packagist.org/packages/grandcreation/silverstripe-widgets)[ RSS](/packages/grandcreation-silverstripe-widgets/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (23)Used By (0)

Widgets Module
==============

[](#widgets-module)

[![Build Status](https://camo.githubusercontent.com/4e17c403c020f50aa1f61df8bcf3c2ee72710718ac400a5248c635f791bb203c/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f73696c7665727374726970652f73696c7665727374726970652d776964676574732e737667)](https://travis-ci.org/silverstripe/silverstripe-widgets)[![SilverStripe supported module](https://camo.githubusercontent.com/9b7e93d393a01f6d3091fb30983b870aa863ef076858115faaa1c74b995854ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73696c7665727374726970652d737570706f727465642d3030373143342e737667)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)[![Code Quality](https://camo.githubusercontent.com/547758b5f1a56dead8609de1edbb3062302ed9efd5e771449e324c419e475337/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73696c7665727374726970652f73696c7665727374726970652d776964676574732e737667)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-widgets)[![Code Coverage](https://camo.githubusercontent.com/4614b2711953c90ac334a782fb7c73bcbd7c2627cf974843fe4bc3cf23b54496/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f73696c7665727374726970652f73696c7665727374726970652d776964676574732e737667)](https://codecov.io/gh/silverstripe/silverstripe-widgets)

Overview
--------

[](#overview)

Widgets are small pieces of functionality such as showing the latest comments or Flickr photos. They normally display on the sidebar of your website.

Requirements
------------

[](#requirements)

- SilverStripe 4.0

**Note:** this version is compatible with SilverStripe 4. For SilverStripe 3, please see [the 1.x release line](https://github.com/silverstripe/silverstripe-widgets/tree/1.3).

### Installation

[](#installation)

Install the module through [composer](http://getcomposer.org):

```
$ composer require silverstripe/widgets

```

Widgets are essentially database relations to other models, mostly page types. By default, they're not added to any of your own models. The easiest and most common way to get started would be to create a single collection of widgets under the name "SideBar" on your `Page` class. This is handled by an extension which you can enable through your `config.yml`:

```
Page:
  extensions:
    - SilverStripe\Widgets\Extensions\WidgetPageExtension
```

Run a `dev/build`, and adjust your templates to include the resulting sidebar view. The placeholder is called `$SideBarView`, and loops through all widgets assigned to the current page.

Alternatively, you can add one or more widget collections to your own page types. Here's an example on how to just add widgets to a `MyPage` type, and call it `MyWidgetArea` instead. Please ensure you add the correct namespaces for your module.

### Installing a widget

[](#installing-a-widget)

By following the "Packaging" rules below, widgets are easily installed. This example uses the Blog module which by default has widgets already enabled.

- Install the [blog module](https://github.com/silverstripe/silverstripe-blog/).
- Download the widget and unzip to the main folder of your SilverStripe website, e.g. to `/widget_/`. The folder will contain a few files, which generally won't need editing or reading.
- Run `http://my-website.com/dev/build`
- Login to the CMS and go to the 'Blog' page. Choose the "widgets" tab and click the new widget to activate it.
- Your blog will now have the widget shown

Documentation
-------------

[](#documentation)

See the [docs/en](docs/en/introduction.md) folder.

Versioning
----------

[](#versioning)

This library follows [Semver](http://semver.org). According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

Reporting Issues
----------------

[](#reporting-issues)

Please [create an issue](http://github.com/silverstripe/silverstripe-widgets/issues) for any bugs you've found, or features you're missing.

- Install the Widgets Module, see above.
- Add a WidgetArea field to your Page.
- Add a new tab to the CMS with a WidgetAreaEditor field for managing the widgets. e.g.

**mysite/code/Page.php**

```
