7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Gallery for Silverstripe
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 842 Views |
-
Gallery for Silverstripe

15 July 2011 at 3:47am
I inherited a silverstripe website and am totally new to it. I was able to get the site up and running from the DVD provided by the client. Now I need to add a photo gallery. DataObjectManager is installed. I tried installing ImageGallery and did a dev/build before and after. I was really hopeful because all looked like it worked, but when I tried to add a new gallery page in the admin, the adding new gallery page appeared with a spinning icon and all of it stayed yellow orange, and kept spinning. It never did create a page and I had to back date my site to recoup the original site and database. I have been reading the posts on the forum and it appears there are a lot of problems with ImageGallery/ My questions, is it possible without a lot of research and reprogramming to get ImageGallery working or is there another Gallery programing that does work with little aggravation. I appreciate any insight to this as I need to get the gallery up without hours and hours of work.
thanks!
Sue YoungSilverstripe is version 2.3.7
-
Re: Gallery for Silverstripe

15 July 2011 at 4:41am
Honestly, the ImageGallery module is just a turnkey solution for a gallery made with ImageDataObjectManager. If you're at all skilled with coding, you can just build one custom with very little effort.
GalleryPage.php
static $has_many = array (
'GalleryImages' => 'GalleryImage'
);public function getCMSFields() {
$f = parent::getCMSFields();
$f->addFieldToTab("Root.Content.Images", new ImageDataObjectManager($this,'GalleryImages','GalleryImage','Image'));
return $f;
}GalleryImage.php
static $db = array (
'Caption' => 'Text'
);static $has_one = array (
'Image' => 'Image'
);public function getCMSFields() {
return new FieldSet (
new ImageUploadField('Image'),
new TextareaField('Caption')
);
}GalleryPage.ss
<% control GalleryImages %>
$Image.CroppedImage(100,100)
<a href="<% control Image %><% control SetWidth(800) %>$URL<% end_control %><% end_control %>view larger</a>
<% end_control %>_config.php
SortableDataObject::add_sortable_class('GalleryImage');That's pretty much it. Can't promise it's free of syntax errors, but you get the gist..
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Gallery for Silverstripe

15 July 2011 at 4:52am
I know only a little of programming. And nothing at all about SilverStripe (was happy I could get the site up and running) I appreciate your response very much, but where would this code go and how would it work?
Meanwhile does anyone else know of a solution?
Sue
-
Re: Gallery for Silverstripe

15 August 2011 at 12:59am Last edited: 15 August 2011 8:28pm
Have you tried installing the uploadify module? Try installing it if you haven't - it worked for me.
http://www.silverstripe.org/uploadify-module/
http://www.leftandmain.com/silverstripe-tutorials/2010/08/30/using-uploadify-in-frontend-forms/
| 842 Views | ||
|
Page:
1
|
Go to Top |


