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, biapar, Willr, Ingo, swaiba, simon_w

More than one widget area?


Reply

5 Posts   2620 Views

Avatar
moccasine

29 May 2009 at 11:31pm Community Member, 2 Posts

Hi,

I'm pretty new to Silverstripe and it didn't take long for me to really really like it. For me one of the most important things with a CMS is the widgets, so my questions are:

1) Isn't it possible to have more than one widget area on one page? I have one to the right of the "main content" and one to the left, but both show the same widgets both public and in admin. Could I have made some misstake here or isn't this feature supported?

2) Can one page inherit a widget area from another page? What I would like, is to have the same area for a group of pages, when managing the widgets it would save a lot of time if I could arrange and setup the widgets once for all the pages in that group.

Many thanks!

Avatar
FungshuiElephant

3 June 2009 at 11:37am Community Member, 57 Posts

1. The simple answer is no, you can't have more than one widget area on a page.

The long answer is sort of. The problem is caused by the way in which widgets are edited - there is an assumption built in to the admin system that each page will only have one widget area, adding another causes lots of problems. You can fake two widget areas on certain layouts by creating a widget that adds the necessary html markup to break your column of widgets into two columns and then use css to position them appropriately.

2. Again the simple answer is no; pagetypes can define widgetareas but not the widgets that are used within them - that info is stored in the db.

Possible solutions are: Run an SQL update query to make all the widgetareas have the same widgets as the master page.
Look at how the Random Content Widget accesses information from other pages, it should be possible to have a given page type look up the widgetarea information from another pagetype.

Avatar
moccasine

4 June 2009 at 4:38pm Community Member, 2 Posts

Thanks for your reply!

I will take a look a bit more at this when I got more time and see if and how I can tweak things so I can setup multiple widget areas on the same page.

Avatar
Nivanka

25 July 2009 at 1:02pm Community Member, 395 Posts

I have being talking about having two widget areas on page, it is not possible at all, but it will be a very useful feature if it is there as for columned website layouts we shall use it without any problem.

But for now we cant do that.

About the second question I would say know, but you can do that by creating a page and duplicating it, and then change the page type. It will work sometimes. But not a proper answer I know.

Avatar
joshy

2 August 2009 at 11:01pm Community Member, 57 Posts

It's quite straightforward to inherit widgets. See my post [url=http://silverstripe.org/customising-the-cms/show/265846?start=0#post265909]here[/url].

Josh