21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 127 Views |
-
Widgets , Time to take them to the next level ? SS3

13 January 2013 at 8:00pm
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
-
Re: Widgets , Time to take them to the next level ? SS3

1 February 2013 at 9:28am
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" .
| 127 Views | ||
|
Page:
1
|
Go to Top |

