Hi, I trying to create a portfolio of website. Each website with an unlimited amount of images. I have got it working with the new ImageField but this imits the amount of images I can upload.
At the moment I have it working to display all the images but there is no relation to the website just all the images I have uploaded.
Website.php
<?php
class Website extends Page {
static $db = array (
'Featured' => 'Boolean',
'Completion' => 'Date'
);
static $has_one = array(
'Website_Browse' => 'Website_Browse'
);
static $has_many = array(
'Images' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->renameField('Title', 'Website Title');
$fields->addFieldToTab('Root.Content.Main', new CheckboxField(
$name = "Featured",
$title = "<strong>Featured Website</strong> - Check to display on the homepage"),
'Content');
$fields->addFieldToTab("Root.Content.Main", new DateField('Completion'));
$images = new ImageDataObjectManager(
$this,
'Images',
'Image'
);
$fields->addFieldToTab("Root.Content.Images",$images);
return $fields;
}
}
class Website_Controller extends Page_Controller {
}