Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Working Gallery Plugin for SS 3

Discuss all other Modules here.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Go to End
Author Topic: 11565 Views
  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    @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

  • Optic Blaze
    Avatar
    Community Member
    162 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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
  • arthurdent
    Avatar
    Community Member
    163 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

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

  • MartinPhone
    Avatar
    Community Member
    57 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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.

  • arthurdent
    Avatar
    Community Member
    163 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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!

  • MartinPhone
    Avatar
    Community Member
    57 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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!

  • Optic Blaze
    Avatar
    Community Member
    162 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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

  • arthurdent
    Avatar
    Community Member
    163 Posts

    Re: Working Gallery Plugin for SS 3 Link to this post

    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.

    11565 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
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.