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