Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Gallery: show image details


Go to End


29 Posts   7850 Views

Avatar
pinkp

Community Member, 182 Posts

13 October 2009 at 7:33am

OK I've done as you've said but I still just get an error after the build :(
I am putting my php files in mysite/code and they are as follows:

MyImageGalleryItem.php

<?php
class MyGallery extends ImageGalleryPage
{
protected $itemClass = "MyImageGalleryItem";
} 

class MyImageGalleryItem extends ImageGalleryItem
{
static $db = array (
'PaintingName' => 'Varchar(100)',
'PaintingDimensions' => 'Varchar(50)',
'Media' => 'Varchar(50)' ,
'Sold' => 'Boolean'
// etc...
);

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'));
$f->push(new CheckboxField('Sold','This painting is sold'));
return $f;
}
}
?>

and MyImageGalleryPage.php

<?php
class MyImageGalleryPage extends ImageGalleryPage {
protected $itemClass = "MyImageGalleryItem";
}

class MyImageGalleryPage_Controller extends ImageGallery_Controller {

}
?>

Do you see what I'm doing wrong!? its the last feature I need for the site, so your help is fantastic thanks!!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

13 October 2009 at 7:56am

You don't need this:

class MyGallery extends ImageGalleryPage
{
protected $itemClass = "MyImageGalleryItem";
}

If you still get an error, paste in so I can see what it is.

Avatar
pinkp

Community Member, 182 Posts

13 October 2009 at 8:21am

I removed that, and now after the build I just have a blank site!? no error message...
Even when I view the page source it is entirely blank!?
removing the 2 php files and doing the build again brings it all back. :s

Avatar
UncleCheese

Forum Moderator, 4102 Posts

13 October 2009 at 8:52am

That's a php error. Turn on your PHP error reporting so you can find out what it is.

Avatar
pinkp

Community Member, 182 Posts

13 October 2009 at 10:56am

OK I've been reading in the docs but don't know exactly how to turn PHP error reporting on...
I looked a my server log and its says this error:

"mysite.co.uk [Mon Oct 12 12:01:18 2009] [error] [client 'ipaddress'] File does not exist: /home/sites/mysite.co.uk/public_html/portfolio, referer: http://www.mysite.co.uk/?flush=1"

portfolio is the name of my theme I don't know if that's relevant...

I don't know where to go from here... any help appreciated? Thank you!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

13 October 2009 at 3:24pm

Depending on your hosting environment, you should be able to do it in your .htaccess file by adding:

php_value display_errors On

Avatar
pinkp

Community Member, 182 Posts

13 October 2009 at 10:44pm

OK I've put

php_value display_errors On

in my ".htaccess" file

and

Director::set_environment_type("dev");
Debug::send_errors_to("me@mydomain.co.uk");

in "_config.php"

and still just the white screen!?
I read about changing errors to on in the php.ini file but I can't find that....

any suggestions?? Thanks!!!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 October 2009 at 2:39am

You could try setting it at runtime in your _config.php

ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');

That's pretty lame that your hosting provider has error reporting turned off. I would talk to them and let them know you're not a mindreader and they need to turn it on.