blynx Posted July 5, 2017 Share Posted July 5, 2017 Hej, A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated (Also pull requests are appreciated ? - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!) Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method: <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so: <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe What do you think? Any ideas, bugs, critique, requests? cheers Steffen 19 1 Link to comment Share on other sites More sharing options...
szabesz Posted July 5, 2017 Share Posted July 5, 2017 This is cool! Thanks a lot. In the near future, I want to port some WP sites with galleries to ProcessWire, so I will definitely give it a try. I put it on my loooooooong todo list Link to comment Share on other sites More sharing options...
grimezy Posted July 6, 2017 Share Posted July 6, 2017 Hey Blynx, Thanks for the nice module Not sure, it's probably just me, but to get this working (local MAMP setup) I had to use the full module class name (MarkupProcesswirePhotoswipe) (not the alias Pwpswp) and the css/javascript etc paths were incorrect , so instead of MarkupPwpswp/path-to-files within the .module file, I had to change these to MarkupProcesswirePhotoswipe/path-to-files After this all worked nicely Thanks again! 3 Link to comment Share on other sites More sharing options...
blynx Posted July 6, 2017 Author Share Posted July 6, 2017 Ah! yep, I renamed the module later on - thats a bug I will correct later. Thanks! 1 Link to comment Share on other sites More sharing options...
blynx Posted July 6, 2017 Author Share Posted July 6, 2017 Update is out: https://github.com/blynx/MarkupProcesswirePhotoswipe Also removed the Pwpswp class alias, because it was pretty pointless. Processwire does not recognise it as a module and I don't really use static methods in that class. 0.5.1 - 2017/07/06, fixes removed: Removed pointless shortcut alias class fixed: Use of correct module/class name for file paths fixed: Configuration instructions for file paths other: Updated readme 5 Link to comment Share on other sites More sharing options...
blynx Posted July 11, 2017 Author Share Posted July 11, 2017 Yay, update: https://github.com/blynx/MarkupProcesswirePhotoswipe Now has some simple 'themes', cooler ones later ... <?php $pwpswp = $modules->get('MarkupProcesswirePhotoswipe'); echo $pwpswp->renderGallery($page->nicePictures, ['theme' => 'h-scroller']); // available themes: plain, flex, h-scroller 0.7 - 2017/07/11, themes fixed: Size option correctly adopts height value added: Theme functionality added: Simple themes 'plain' (previous default), 'flex', 'h-scroller' other: Updated readme other: No notice on undefined photoswipe options other: Refactoring 5 Link to comment Share on other sites More sharing options...
cstevensjr Posted August 20, 2017 Share Posted August 20, 2017 A great module! I needed a photo gallery for a few websites and this works fantastic. Please go ahead and get this module published in the ProcessWire Module Directory. 2 Link to comment Share on other sites More sharing options...
blynx Posted August 21, 2017 Author Share Posted August 21, 2017 Now in the modules directory. Want to update the module soon with some new flavors ... http://modules.processwire.com/modules/markup-processwire-photoswipe/ Cheers! 6 Link to comment Share on other sites More sharing options...
cstevensjr Posted August 21, 2017 Share Posted August 21, 2017 Thanks! 3 Link to comment Share on other sites More sharing options...
flydev Posted September 26, 2017 Share Posted September 26, 2017 Hey @blynx, It is voluntary to make this module only compatible with PHP 7 ? I wanted to give a try to your module for a website I am building right now - using PHP 5.6 - but calling the module with : $pwpswp = $modules->get('MarkupProcesswirePhotoswipe'); $gallery = $pwpswp->renderGallery($page->gallery, ['theme' => 'masonry']); give me the following error (due to scalar type arguments) : Anyway, already loving it, thanks for making this module. I am using it with InstagramFeed, IsotopeJS and InfiniteScroll in a custom theme - Masonry - based on the Plain one : 2 Link to comment Share on other sites More sharing options...
blynx Posted September 26, 2017 Author Share Posted September 26, 2017 Nice, glad you like it! I will consider this and probably change that - thanks for the feedback! 2 Link to comment Share on other sites More sharing options...
blynx Posted November 13, 2017 Author Share Posted November 13, 2017 Ok, so there is the new version out now which includes a gallery type like the ones in the medium articles. The whole module has been rewritten and I changed the way the galleries are rendered. Instead of weird template files the galleries are now modules which extend the MarkupPwpswpGallery module. Have a look at the readme for some more info. Everything should work just fine when updating despite the code changes. I build a gallery module which should ensure compatibility in case anyone was using her/his own template file. This is the new gallery type „Petersburger Hängung“ The inspiration for that type: https://github.com/SiteMarina/guggenheim The linear partition problem:http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTMhttps://github.com/crispymtn/linear-partition/blob/master/linear_partition.coffee#L11 (coffee script) Yet, I implemented a simplier and I guess faster algorithm: https://stackoverflow.com/a/6670011/3004669 Maybe I will implement the original algorithm, too, at some point. ... 8 Link to comment Share on other sites More sharing options...
JasonS Posted November 18, 2017 Share Posted November 18, 2017 Updated to the new version and it completely broke my site on my local machine. see attached image. Link to comment Share on other sites More sharing options...
matjazp Posted November 18, 2017 Share Posted November 18, 2017 It looks like Tracy bd call. Either install Tracy or remove that bd() in line 471. 1 Link to comment Share on other sites More sharing options...
blynx Posted November 18, 2017 Author Share Posted November 18, 2017 @JasonS Noooooo, I was afraid this would happen. It is fixed now! Sorry! Yep, that was a Tracy bd() call ... as a quick fix you may just remove that line ... 1 Link to comment Share on other sites More sharing options...
JasonS Posted November 21, 2017 Share Posted November 21, 2017 I tried to update my installation with the new updated version and still failed to update safely. Link to comment Share on other sites More sharing options...
blynx Posted November 22, 2017 Author Share Posted November 22, 2017 Hm! This is weird - but it looks like a permissions problem on your side? I guess you can fix this by setting the file/folder permissions. I couldn't find anything wrong here at my place - is the folder name of the module correct? How did you install it? Sorry for the trouble - will have a closer look later the week Maybe try a fresh installation of the module for now - Link to comment Share on other sites More sharing options...
JasonS Posted November 22, 2017 Share Posted November 22, 2017 13 minutes ago, blynx said: Maybe try a fresh installation of the module for now - Yes, This worked. Thank you for the great module. I noticed a small typo just FYI. 1 Link to comment Share on other sites More sharing options...
blynx Posted November 22, 2017 Author Share Posted November 22, 2017 Link to comment Share on other sites More sharing options...
Mats Posted November 22, 2017 Share Posted November 22, 2017 Great module @blynx! Thanks for coding it. Would you consider making a caption option? I can't seem to find any at the moment. 1 Link to comment Share on other sites More sharing options...
blynx Posted November 22, 2017 Author Share Posted November 22, 2017 2 hours ago, Mats said: Great module @blynx! Thanks for coding it. Would you consider making a caption option? I can't seem to find any at the moment. ah yep, noticed that the captions were missing the other day. Will look into it! 2 Link to comment Share on other sites More sharing options...
Mats Posted November 22, 2017 Share Posted November 22, 2017 Thanks! Link to comment Share on other sites More sharing options...
Anton Posted May 9, 2018 Share Posted May 9, 2018 Hi ! Thanks for the module. I tried to install it in a local MAMP setup. But it does not load everything... Any idea ? Link to comment Share on other sites More sharing options...
blynx Posted May 17, 2018 Author Share Posted May 17, 2018 Hi! Mh can't really tell from that screenshot. One thing I noticed by myself already is, that it doesn't seem to work when caching is turned on - but I can't find the time to work on it right now. : | Can you have a look into the markup and see what actually was appended, also which actual paths/urls are used which are failing here? cheers! Link to comment Share on other sites More sharing options...
cstevensjr Posted September 2, 2018 Share Posted September 2, 2018 I have used your great module on my PHP 5.6 installations. I am working on a new website and would like to use this module. I am getting the following error on installation: Any help you can provide with how to get this installed would be greatly appreciated. By the way, I am getting a similar error when trying to upgrade from your version 7.2 to 9.2.2 (whether using PHP 5.6.x, PHP 7.0.x or PHP 7.2.x) PHP 5.6.x PHP 7.0.x PHP 7.2.x Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now