7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Image gallery problem
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 1252 Views |
-
Image gallery problem

16 June 2010 at 5:54am Last edited: 16 June 2010 5:55am
Hi UncleCheese
I am now thoroughly confused. I have upload new site with ss 2.4 and have DOM and Image gallery. I have an image gallery page top level and all albums work fine. As soon as I go down a level and setup a image gallery page it throws up an error when I click on an album. Works Top level works, not sub level. Wacky any ideas.
Steve
"Trying to get property of non-object"
GET /what-we-do-2/test-gallery/album/test1
Line 194 in /www/sw1b/image_gallery/code/ImageGalleryPage.php
Source
185 if($url_segment = Director::urlParam('ID')) {
186 $albums = DataObject::get($this->albumClass,"ImageGalleryPageID = {$this->ID} AND File.Name = '$url_segment'", "", "LEFT JOIN File ON File.ID = FolderID");
187 return $albums ? $albums->First() : false;
188 }
189 return false;
190 }
191
192 public function AlbumTitle()
193 {
194 return $this->CurrentAlbum()->AlbumName;
195 }
196 -
Re: Image gallery problem

16 June 2010 at 6:23am
Looks like an old version of ImageGallery to me. When was the last time you updated? That code isn't 2.4 compatible.
-
Re: Image gallery problem

16 June 2010 at 6:34am
Seems like a possibility as I have been working on existing sites with 2.3 and new sites with 2.4 so could be mixed up somewhere. Can I just copy all files/folders except the templates or have the template got new elements.
-
Re: Image gallery problem

16 June 2010 at 7:21am
yes only the theme templates to work with my layout??
-
Re: Image gallery problem

16 June 2010 at 7:26am
You should never have to modify any of the templates, code, or CSS in a module. Silverstripe gives you a full-featured theming framework.. use it!!
Any template you place in your theme dir will override its counterpart in a module. Same with CSS.
If you add /your_theme/templates/Layout/ImageGallery_album.ss to your site, SSViewer will look there first before falling back on the default templates for ImageGallery. Likewise, /your_theme/css/ImageGallery.css will override the core CSS.
Modules should remain insular so that you don't have to pull your hair out when an upgrade comes out!
-
Re: Image gallery problem

16 June 2010 at 7:37am
So if I wanted the sidebar menu from the templates which is located in the blackcandy layout folder to appear in the gallery page where would this be amended.
-
Re: Image gallery problem

16 June 2010 at 8:05am
Wherever you want it to go. Once a template is in your theme dir you can do whatever you want. Just don't alter the one in the image_gallery directory.
| 1252 Views | ||
| Go to Top | Next > |

