I added a photo to a page with the following method (actually to a Product in the ecommerce module to be more precise):
static $has_one = array(
'Photo' => 'Image'
);
and
function getCMSFields($cms) {
$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
return $fields;
}
I have photos in an asset folder. I can only associate each of these photos to only one page, as soon as the photo is used, it becomes unavailable for selection to other pages.
Could someone please help? I suspect it's a one to many type relationship I need to develop, but I am lost at this stage.