Hi this is great exactly what I also needed. However Im having problems, Im new to the classes and php etc and I'm not sure where to put the code.
I created MyGallery.php from your example and placed it in the ImageGallery code folder:
class MyGallery extends ImageGalleryPage
protected $itemClass = "MyImageGalleryItem";
class MyImageGalleryItem extends ImageGalleryItem
static $db = array (
'PaintingName' => 'Varchar(100)',
'PaintingDimensions' => 'Varchar(50)',
'Media' => 'Varchar(50)'
public function getCMSFields_forPopup()
$f = parent::getCMSFields_forPopup();
$f->push(new TextField('PaintingName','Name of painting'));
$f->push(new TextField('PaintingDimensions','Dimensions of painting'));
After a dev/build I got this error:
[User Error] Couldn't run query: SELECT `ImageGalleryItem`.*, `MyImageGalleryItem`.*, `ImageGalleryItem`.ID, if(`ImageGalleryItem`.ClassName,`ImageGalleryItem`.ClassName,'ImageGalleryItem') AS RecordClassName FROM `ImageGalleryItem` LEFT JOIN `MyImageGalleryItem` ON `MyImageGalleryItem`.ID = `ImageGalleryItem`.ID WHERE ((AlbumID='15') AND (`ImageGalleryPageID` = '11')) ORDER BY SortOrder ASC LIMIT 0,10 Table 'jacquifenn.MyImageGalleryItem' doesn't exist
Sorry if this is a very obvious mistake but could you please advise me of exactly where and how to use the code?
I also changed the UI_layout as you described.
I also need a sold feature which will show a red dot next to the painting description.
Could you please suggest a way to do this?
i.e. a check box 'sold [ ]' in the pop up menu for each gallery item if ticked it shows a red dot, perhaps a jpg, next to the PaintingName.
Thank you for your time and any help!! much appreciated.