Jump to:

794 Posts in 409 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » General Widget Question

Discuss SilverStripe Widgets.

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

Page: 1 2
Go to End
Author Topic: 6340 Views
  • KeithLeslie
    Avatar
    Community Member
    6 Posts

    General Widget Question Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: General Widget Question Link to this post

    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

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: General Widget Question Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: General Widget Question Link to this post

    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.

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: General Widget Question Link to this post

    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

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: General Widget Question Link to this post

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

  • tzeller
    Avatar
    Community Member
    26 Posts

    Re: General Widget Question Link to this post

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

    GoogleChartWidget.php Line 17 downwards:

    "FrameWidth" => "Int"

    is missing

  • ulysses
    Avatar
    Community Member
    57 Posts

    Re: General Widget Question Link to this post

    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

    6340 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.