Here is my code. I am assuming that i have too make a template for the testimonials page, But since i am a noob I am not sure how.
I guess my question is how do I get the data to appear on the page?
Testimonial.php.....
<?php
class Testimonial extends DataObject
{
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')
);
}
}
?>
TestimonialPage.php
<?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;
}
}
?>