Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Gallery: show image details

Discuss all other Modules here.

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

Page: 1 2 3 4
Go to End
Author Topic: 4582 Views
  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Gallery: show image details Link to this post

    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!!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Gallery: show image details Link to this post

    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.

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Gallery: show image details Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Gallery: show image details Link to this post

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

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Gallery: show image details Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Gallery: show image details Link to this post

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

    php_value display_errors On

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Gallery: show image details Link to this post

    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!!!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Gallery: show image details Link to this post

    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.

    4582 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.