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 displaying
Please help me, its very urgent for me.