I am tring to do the same thing My code is
MyImageGalleryItem.php
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'));
$f->push(new TextField('Media','Media'));
return $f;
}
}
?>
MyImageGalleryPage.php
<?php
class MyImageGalleryPage extends ImageGalleryPage {
protected $itemClass = "MyImageGalleryItem";
}
//class MyImageGalleryPage_Controller extends ImageGallery_Controller {
class MyImageGalleryPage_Controller extends ImageGalleryPage_Controller {
}
?>
the upper two files are inside code under /mysite/code
and /blackcandy/templates/Includes/GalleryUI_layout.ss
<% if GalleryItems %>
<ul class="gallery-layout" id="gallery-list">
<% if GalleryItems.NotFirstPage %>
<% control PreviousGalleryItems %>
<li style="display:none;">$GalleryItem</li>
<% end_control %>
<% end_if %>
<% control GalleryItems %>
<li style="height:{$ThumbnailHeight}px;width:{$ThumbnailWidth}px;">
$GalleryItem
<h3>$PaintingName</h3>
</li>
<% end_control %>
<% if GalleryItems.NotLastPage %>
<% control NextGalleryItems %>
<li style="display:none;">$GalleryItem</li>
<% end_control %>
<% end_if %>
</ul>
<% end_if %>
and i have done dev/build
though the page is there and its creating a new template but when I am opening the page there is no image even though i have added a new album and image in this page.I need to print a image name below the image
there is no error also
Please help me.
thank you in advance