Hi all! I'd like to put an image carousel in my homepage picking the images to use from my authorpage pages were I have for each one a reference image. The author page is made following the tutorial "extending a basic site".
The problem is how to find the image from that kind of pages to use it in the homepage. How to write the correct query? I can have other data from that page but not the image that have a has_one relation.
Here the code...
/**
*Define the author page type
*/
class AuthorPage extends Page {
static $db = array(
'AuthorName' => 'Text',
'AuthorType'=>'Text'
);
static $has_one = array(
'ImgAnteprima'=>'Image'
);
//static $icon = "mysite/images/news";
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('AuthorName'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('AuthorType'), 'Content');
$fields->addFieldToTab("Root.Content.Images",new ImageField('ImgAnteprima'));
return $fields;
}
}