Jump to:

10843 Posts in 2514 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Please Help in Widget

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 564 Views
  • webcook
    Avatar
    Community Member
    20 Posts

    Please Help in Widget Link to this post

    Hi,
    <br >Am new for developing widget in silver stripe.
    <br >using the below coding am generate the story widget.
    <br >It works perfectly but i cant able to see those values in pages.
    <br >
    <br >I dont know how to create Story Holder page.What is the use of Holder page. how to map the holder page with widget.
    <br >
    <br >
    <br >
    <br >class StoryWidget extends Widget {
    <br >   static $db = array(
    <br >      'StoryTitle' => 'Varchar(255)',
    <br >       'Content' => 'Text',
    <br >       'StoryDate' => 'Date'
    <br >   );
    <br >
    <br >   static $title = 'New Story';
    <br >   static $cmsTitle = 'Story Content';
    <br >   static $description = 'Adds HTML content to the widget sidebar. <br />(Save and refresh the page if you cannot see the text editor field.)';
    <br >   
    <br >   function Title() {
    <br >      return $this->WidgetTitle ? $this->WidgetTitle : self::$title;
    <br >   }
    <br >   
    <br >   function Output() {
    <br >      $output = new DataObjectSet("storywidget");
    <br >      $return_value = $output->groupBy('ID');
    <br >      return $return_value;
    <br >   }
    <br >
    <br >   function getCMSFields() {
    <br >      $fields = new FieldSet();
    <br >      $fields->push(new TextField('StoryTitle'));
    <br >      $fields->push(new TextareaField('Content', 'Story description'));
    <br >      $fields->push(new DateField('StoryDate', 'Story date 01/01/1900'));
    <br >      return $fields;
    <br >   }
    <br >}
    <br >
    <br >Thanks
    <br >G

    564 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.