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.

Data Model Questions

Page $db array


7 Posts   2221 Views


13 March 2009 at 11:44am Community Member, 254 Posts

Hi all, I'm still new with Silver Stripe (but loving its flexiblity soo much!).
I'm trying to build a module to intergrate with Slide Show Pro. The first draft is still in development. All I'm trying to do is supply a drop down with availible gallerys in my slide show pro page.
It's kind of there but keep getting errors when trying to do a DB build the cause seems to be in here

   static $db = array (
      'Gallery' => 'Enum($this->getAlbumName())'

I get the following

Warning: Cannot modify header information - headers already sent by /sapphire/core/Debug.php on line 151

I've been trying to resolve this on my own but frustration is building. Any pointers? I'm still very noob and don't quite have my head arround all the API

Here is the album func

   public function getAlbumName() {
      $result = $this->dbGet();
      $tailValue = array_pop($result);
      foreach($result as $value) {
         $albumOptions .= $value.',';
      $albumOptions .= $tailValue;
      return $albumOptions;


13 March 2009 at 11:55am Administrator, 685 Posts

Hi Bambii,

You can't call a method inside the enum values. Perhaps it would be better if you had a separate page type that listed your Galleries, and then did this:

class SlideShowProPage {
static $has_one = array(
"Gallery" => "Gallery"

Then you can use $Gallery.Title to display the Title field of the related gallery object in your database.


13 March 2009 at 3:31pm 4085 Posts

Also, you might want to get in touch with Josh from Silverstripe. He's been working on the Slideshow Pro module for SS. Also, see my ImageDataObjectManager or ImageGallery module for robust management and uploading of image files. You can probably build off one of those and generate an XML feed for SSP.


16 March 2009 at 4:53pm Community Member, 254 Posts

Thanks for your reply Sam.
So that explains why I'm getting an error!
The easiest method would be to paste the gallery name into a custom page field. I was trying to make it a little simpler by creating a drop down of all availible albums. I just haven't sussed out the method yet. I will post back here once I crack it, should be too hard.


16 March 2009 at 4:58pm Community Member, 254 Posts

Oh I didn't realise someone was already undertaking the SSP module, I'll try and contact him, cheers uncle cheese. I built a basic image gallery off the fileManager module. But there were issues with image stamping (shigh...) I just went for the sure win and brought a copy of Slide Show Pro. It's a very nice method to administrate images.


16 March 2009 at 5:28pm 4085 Posts

I've actually gone ahead and built an SSP module off the ImageGallery. Should be ready very soon.


16 March 2009 at 8:52pm Community Member, 18 Posts

Hi Uncle Cheese

I tried to catch you on another old topic, but I think I didn't catch you.
Can you please help me with

Thanks in advance.

Best regards Trym
I'm sorry to disrupt this thread, but don't know how to get in touch in other ways.