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.

Widgets /

Discuss SilverStripe Widgets.

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

General Widget Question


Go to End


13 Posts   10039 Views

Avatar
KeithLeslie

Community Member, 6 Posts

4 January 2009 at 4:37pm

Are widgets only for use with the blogs? The documentation makes it sound like widgets can only be used with the blogs. Is this correct? Is there any widget construct for using something like a widget on the home page? I have to show 3 posts from an RSS feed. I have the PHP code ready, but not sure how to integrate. Any help would be greatly appreciated.

Avatar
Willr

Forum Moderator, 5523 Posts

4 January 2009 at 5:58pm

Currently by default only the blog makes use of widgets but there is no reason why they can't be used on other pages. See this page for more information

http://doc.silverstripe.com/doku.php?id=widgets#adding_widgets_to_other_pages

Avatar
micahsheets

Community Member, 165 Posts

10 January 2009 at 8:42am

I have made it so my widgets can show up on all my pages. However I can't figure out how to make a global interface to manage the content in my widget. I don't want to have to go to every page and manually set up the widget since it should show the same info on each page. However I also want to be able to manage this from a gui and not the _config file. One widget I have is an advertising area where the site owner can select an image and type some text in as a description or link to more info etc. The way it seems to work is every page I add the widget to I have to link to the image and type the text in.

I have read some things on the forum about having a global settings area but it seems that the developers may not like this idea as it may be over designing. I think having a way for developers to add system wide settings is very important as I have many things I would like to put in such an interface that would make managing the site better for non-developer/programmer types.

Please consider again adding a way to manage global widgets with the ability to show or not show the global widget on page types.

Also I really would like to see widgets stored in a widgets folder at the root instead of having separate folders for each one at the root of the site.

thanks

Avatar
Hamish

Community Member, 712 Posts

10 January 2009 at 7:52pm

Edited: 10/01/2009 7:56pm

To make it appear on all pages you could create a special 'PageHolderPage' that all other pages are descendants of.

Ie, in your site tree, your site would look something like:

root
_+- PageHolder
___ +- Home
___ +- About
___ +- Stores
_____ +- Auckland
_____  +- Wellington
____ +- Contact

edit: GAH, why does the forum code block not respect whitespace? Impossible for format code nicely!!! Pretend that those underscores are spaces..

You apply the widget to the PageHolder page. Since all other pages are descendants of this one page, you can also access this 'global' widget (or whatever other data is held by PageHolder) with the appropriate tags.

This is a nice clean way to emulate a 'system wide' setting (or, really, just a root page setting) without adding new functionality.

Avatar
Hamish

Community Member, 712 Posts

10 January 2009 at 7:59pm

Edited: 10/01/2009 7:59pm

Note that this is exactly what happens in the blog - the BlogHolder object holds the widget, while the actual pages you see are BlogEntry objects. We're just extending the concept to cover the whole site :)

Avatar
micahsheets

Community Member, 165 Posts

15 January 2009 at 10:56am

Ok, I see how that would work. What tag would cause the parent page widget to show up in the child pages?

Avatar
tzeller

Community Member, 26 Posts

18 January 2009 at 7:38am

i have found an error in the php-script which causes a width-problem

GoogleChartWidget.php Line 17 downwards:

"FrameWidth" => "Int"

is missing

Avatar
ulysses

Community Member, 57 Posts

24 November 2009 at 2:13pm

Hi Hamish,

I like your concept of the PageHolder page.

Do you have an example on this implementation. Or better still can a copy of this page be posted on this forum.

I am trying to make the Widgets available on every page type in SilverStripe 2.3.3 but the Widgets tab is only available in the Blog page type in the CMs.

My Skype ID is: ulyssesnz

Your help would be much appreciated.

Mauricio

Go to Top