I have read the tutorial for creating a function to resize an image but i cannot seem to get it to work correctly. Here is my scenario:
GalleryItemHolder.ss - this is the main Holder template that will contain the resized thumbnails
GalleryItemPage.ss - this is the detail page for each of the GalleryItems - the images that are resized on the Holder page are attached so the GalleryItemPage class
I have added the following code to the GalleryItemPage.php
class GalleryItemPage extends Page {
static $db = array(
);
static $has_one = array(
'GalleryItemImage' => 'Image',
'GalleryItemThumb' => 'GalleryItemPage_Thumb150px'
);
on what page do i put the following function class?
class GalleryItemPage_Thumb150px extends Image {
function generateThumb150px($gd) {
return $gd->resizeRatio(150,150);
}
If I put in the GalleryItemPage.php file, it does not seem to be callable in the GalleryItemHolder.ss template - which is where i want the resized thumbnails to be generated.