I'm trying to add multiple images to Product Pages
I'm having trouble, whenever I try to access the images from in the CMS or in the site I get :
Website Error
There has been an error
The website server has not been able to respond to your request.
Here is my code from the ProdImage.php
class ProdImage extends DataObject
{
static $db = array (
'Name' => 'Text',
'Description' => 'Text',
'Category' => "Enum('Product, Lifestyle')"
);
static $has_one = array (
'Attachment' => 'File'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Name'),
new TextareaField('Description'),
new DropdownField('Category','Category', singleton('ProdImage')->dbObject('Category')->enumValues()),
new FileIFrameField('Attachment')
);
}
}
and from my product.php
static $has_many = array (
'ProdImage' => 'ProdImage'
);
...
$manager = new ImageDataObjectManager(
$this, // Controller
'ProdImage', // Source name
'ProdImage', // Source class
'Attachment', // File name on DataObject
array(
'Name' => 'Name',
'Description' => 'Description',
'Category' => 'Category'
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$manager->setFilter(
'Category', // Name of field to filter
singleton('ProdImage')->dbObject('Category')->enumValues() // Map for filter (could be $dataObject->toDropdownMap(), e.g.)
);
// If undefined, all types are allowed. Pass with or without a leading "."
// Label for the upload button in the popup
$manager->setBrowseButtonText("Upload (PNG or JPG only)");
// In grid view, what field will appear underneath the icon. If left out, it defaults to the file title.
$manager->setGridLabelField('Name');
// Plural form of the objects being managed. Used on the "Add" button.
// If left out, this defaults to [MyObjectName]s
$manager->setPluralTitle('ProdImage');
$fields->addFieldToTab("Root.Content.ProdImage", $manager);
return $fields;
I'm assuming its something simple I'm just not seeing
Thanks in Advance