10448 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 191 Views |
-
Testimonial page error

22 June 2012 at 11:34pm
hi,
I am using silverstripe v2.4.7 , it is working fine. now i want to incorporate Testimonial page for my cms.
for that i have created a page Testimonial.php and i put the page into mysite/code folder<?php
class Testimonial extends Page
{
static $db = array (
'Date' => 'Date',
'Author' => 'Text',
'Quote' => 'HTMLText'
);static $has_one = array (
'TestimonialPage' => 'TestimonialPage'
);public function getCMSFields_forPopup()
{
return new FieldSet(
new CalendarDateField('Date'),
new TextField('Author'),
new TextareaField('Quote')
);
}
}
class Testimonial_Controller extends Page_Controller{
}
---------------------------------------------------------------------------------------------
Then i have created one more page called TestimonialPage.php and i put the page into mysite/code folder<?php
class TestimonialPage extends Page
{
static $has_many = array (
'Testimonials' => 'Testimonial'
);public function getCMSFields()
{
$f = parent::getCMSFields();
$f->addFieldToTab("Root.Content.Testimonials", new DataObjectManager(
$this,
'Testimonials',
'Testimonial',
array('Date' => 'Date','Author'=>'Author','Quote' => 'Quote'),
'getCMSFields_forPopup'
));
return $f;
}
}class TestimonialPage_Controller extends Page_Controller {
}-------------------------------------------------------------------------------------------------------------------------
after that i build, and i logined to admin, there i select the Testimonials page in the dropdown list and click on the go button
here page is created in the sitetree called Testimonial but
the TAB Testimonial is not displayingPlease help me, its very urgent for me.
| 191 Views | ||
|
Page:
1
|
Go to Top |

