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.

All other Modules

Discuss all other Modules here.

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

Working Gallery Plugin for SS 3


Reply

106 Posts   12180 Views

Avatar
martimiz

30 April 2014 at 9:23pm Forum Moderator, 1095 Posts

@arthurdent: I guess we all know about late hour frustrations, but please keep in mind that this is a free addon and its creator is actually trying to help you. Also he clearly states it has not been tested on 3.1.3 yet.

If you are experiencing problems with this addon (or any other addon) that you think may be a bug, please create an issue on GitHub:

https://github.com/OpticBlaze/ss3Gallery/issues

Avatar
Optic Blaze

30 April 2014 at 9:59pm Community Member, 162 Posts

Ok i think I got the solution:

Turns out it was a permissions issue. I will update the Github repro, but i thought i would post the solution in the interim:

GalleryPage.php (model section-- add this above the getCMS function)
-----------------------------------------------------------------------------

// Set Permissions
function canView($Member = null){if(permission::check('VIEW_GALLERY')){return true;}else{return false;}}
function canEdit($Member = null){if(permission::check('EDIT_GALLERY')){return true;}else{return false;}}
function canCreate($Member = null){if(permission::check('EDIT_GALLERY')){return true;}else{return false;}}

GalleryPage.php (replace the page controller section with this)
--------------------------------------------------------------------------------

class GalleryPage_Controller extends Page_Controller implements PermissionProvider {
      
      //Add permissin check boxes to CMS
      public function providePermissions() {
      return array(
       "VIEW_GALLERY" => "View Gallery Pages",
       "EDIT_GALLERY" => "Edit Gallery Pages",
      );
      }
   
   public function GetGalleryImages() {
      return $this->GalleryImages()->sort("SortOrder");
   }
}

GalleryImage.php
------------------------------------------------------------
Ass this above the getCMS function

// Set Permissions
function canView($Member = null){if(permission::check('VIEW_GALLERY')){return true;}else{return false;}}
function canEdit($Member = null){if(permission::check('EDIT_GALLERY')){return true;}else{return false;}}
function canCreate($Member = null){if(permission::check('EDIT_GALLERY')){return true;}else{return false;}}

______________________________________________________________________________________________

1) Run dev build
2) The above creates check boxes in the security section of the cms where you can now allocate permissions to the Content_Author group
3) Check both boxes so user can view and edit...save

This should now enable the Content_Author to see and edit the gallery pages

I am planning a rework of the SS3 Gallery will push to Github when i am done.

I have included the complete sample code in a zip file as well.

Attached Files
Avatar
arthurdent

1 May 2014 at 9:20am (Last edited: 1 May 2014 9:20am), Community Member, 166 Posts

martimiz - apologies if it seemed that I was 'flaming'. I have had more than one late night trying to get my head around this issue and yes, I was getting somewhat frustrated and, dare I say, desparate!

And Optic Blaze - a huge thank you once again! Really appreciate your help. I'll update site and give it a whirl. Watch this space...

Avatar
MartinPhone

2 May 2014 at 9:57am (Last edited: 2 May 2014 10:01am), Community Member, 57 Posts

Gosh this really is confusing. arthurdent I feel your pain and optic blaze thanks for a (potentially!) great module.

I'm having a lot of the problems arthurdent was having.

I go to the github and get the latest version of everything, and I get the Fatal Error.

I go through this thread, I change the version of GridFieldBulkEditingTools, SortableGridField and ss3Gallery in numerous permutations and the nearest I can get to it working is the one where it hangs on uploading.

Can anyone help to get a gallery module running 'out of the box' for SS3?

I have been working with 3.13.

EDIT: FWIW, I just went and experimented with Wordpress. Within about 10 minutes I've got a site on my machine with a really slick looking gallery page with carousel type slideshow, full res version and thumbnails. Why exactly am I still using SS?! I really want to stick with it but I'm finding it harder and harder to justify to myself.

Avatar
arthurdent

2 May 2014 at 10:13am Community Member, 166 Posts

Not wanting to stray 'off topic' here but - I have experience with WP as an administrator so I do know the backend but haven't built a site. WP has a lot of features but my client that owns the WP site often asks me to do some administrative tasks simply because the interface is so complex (and it's just got even more complex!).

I recommend SS to my clients mainly because the back end is so simple - almost like a Word Processor interface, so they don't find it at all intimidating. Also if you don't use a lot of complex features you simply don't install certain modules so you have a lower overhead. And finally I'm a New Zealander (in Wellington to boot - pun not intended) so I'm supporting a local development community and a local product!

Avatar
MartinPhone

2 May 2014 at 10:42am Community Member, 57 Posts

I absolutely agree which is why this is so disappointing. I think I'm going to making a general-disenchantment-with-ss thread in the General forum!

Avatar
Optic Blaze

2 May 2014 at 12:27pm (Last edited: 2 May 2014 12:34pm), Community Member, 162 Posts

I have updated the repro on Github https://github.com/OpticBlaze/ss3Gallery and made it more 'out of the box' ready. All you have to do is just include the <% include PhotoGallery %> where you want it do display in your template. I have tested it on 3.1.4 and it works fine (this includes the permissions that arthurdent was querying). The module also now works with the latest builds of sortable grid field as well as bulk upload and editing tools.

Please note that i have not added my module to http://addons.silverstripe.org/add-ons for a reason...which is that i dont think it is good enough yet. You guys are welcome to use it if you want...but i dont make any promises....i will try and help where i can

@MartinPhone: You wonder why everything is'nt easy? You want it to be easy.....then why don't you write your own modules and open source it? Why don't you spend the hours and hours figuring out stuff so that others can download it and use it.
You want things to be better...you want the world to change...then BE the change.

Silvestripe is a small community...here you can be apart of something...at Wordpress you are just another number....you choose

Avatar
arthurdent

2 May 2014 at 12:50pm Community Member, 166 Posts

Well said, Optic Blaze. I, for one, really appreciate the time you have put in to this and totally agree with your comments! While I'm not a programmer, I'm hoping to be able to contribute to the SilverStripe community in the Themes department once I have something ready.