Jump to:

22992 Posts in 11842 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Widgets , Time to take them to the next level ? SS3

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 267 Views
  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Widgets , Time to take them to the next level ? SS3 Link to this post

    Hi, I been playing around with widgets & I feel there is alot can be done & docs doesn't have alot of info about them. I will use this topic to ask questions & make it easier for others to find this info too :

    class HomePage extends Page{

    static $db = array(

    );
    static $has_one = array(
    ''MyWidgetArea' => 'WidgetArea'
    );
    }
    1- How can I limit the number of widgets in 'MyWidgets'?
    2- How can I make a widget unique per page , so a widget can be used only once in 'MyWidgets' ?

    Thanks

  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    Re: Widgets , Time to take them to the next level ? SS3 Link to this post

    Hi, here is some code I been working on : http://www.sspaste.com/paste/show/51035a801337e
    This adds a ParentID and ParentClassName to WidgetArea when they are related to Page(or its subclasses ) . I needed this when I wanted MyWidget to know its "Owner Page" .

    267 Views
Page: 1
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.