ImageFlow Gallery

Permalink 1 user found helpful
Here's my contribution to the image gallery mix. Saw ImageFlow mentioned in here and I liked it, so I thought I'd try my hand at creating my first block by adapting ImageFlow to work in here (you may recognize the base code from the Slideshow block). I'm also new to php in general, so if any of you expert-types have any suggestions to make this code better, please let me know.

Oh, and the "legal stuff": commercial use of the ImageFlow gallery is not free, so head on over to their site if you end up using it:
http://finnrudolph.de/ImageFlow/Download...

I included some customization options in the block setup form, but there are more options lurking in the code and even a couple of database fields created that I decided not to use (at least not yet :)

"Gallery Title" I intend to use in my implementation by creating an Image Gallery Autonav block that grabs all of the galleries on a page and list them by Gallery Title. Clicking on a gallery would then hide the other galleries and show only the one you selected. I just haven't gotten that far yet. I'm open to other suggestions about how this should work.

(By the way, I typed this whole post one-handed while rocking my teething baby back to sleep, so please excuse any typos :)

By the other way... I just realized I never tested this in IE, or Safari, or etc. - only Flock (and I suppose by extension, Firefox) - and the loading bar is doing a strange thing in IE. Any ideas on fixing my CSS? (Did I mention I'm rather new to CSS as well :)?

Update: If the images don't show up, try changing the "reflections" property to "false" in the defaults section near the top of imageflow.js. Also, check your PHP/GD version (Thanks Remo!). There are some other defaults in that file that you can change, as well.

1 Attachment

AndyB37
 
Remo replied on at Permalink Reply
Remo
especially for someone who's new to c5 and css! I wonder what you'll do when you're not new to these things anymore ;-)

In case someone can't see the pictures. This is probably a problem with GD. His reflect scripts needs at least 2.0.1 or later. There's a problem with PHP/GD if you don't link it statically, php doesn't know about the exact gd version.. But I guess I'm the only one who doesn't use a static version ;-)

Couldn't we merge the ImageFlowGallery block with the Gallery Block? Having multiple templates is nicely implemented in concrete5 and would make it easier to switch between the layouts...

But I'm aware that you need a few options (checkboxes) that are not needed by all the galleries.... Just something to think about :)

Keep up the great work!
AndyB37 replied on at Permalink Reply
AndyB37
I think making a few templats to Image Gallery would be a good idea. I don't know if people would frequently want to hide the slider or the caption anyway, so maybe there could be a couple of templates with different background colors. Like having templates named:
ImageFlow Black
ImageFlow White
Remo replied on at Permalink Reply
Remo
we could make a dynamic form that changes the options/fields depending on the template... that would mean we would have to write some custom non-c5 code to get the template but in theory it should work..

takes more than 5 minutes but might be nice.
LucasAnderson replied on at Permalink Reply
LucasAnderson
I do plan on having multiple different types of gallery engines for the gallery block, but the only requirement is that the license should not be restrictive.

ImageFlow does not have an open license, so it will most likely not be merged into the gallery block.
Remo replied on at Permalink Reply
Remo
I agree with Lucas.

Including ImageFlow in the "default gallery" block might be a problem but if it's easy to add a new template, this shouldn't be a problem..

Install the gallery block, install the imageflow template. Means there are two steps but I think that's okay if there's no open license...

We just have to find a nice and flexible way to add templates with different options/parameters.. xml?
trimper replied on at Permalink Reply
trimper
I'm not sure if I missed something, but I decided to try this out, but instead - I get the following error:

Warning: Loader::require_once(/Applications/MAMP/htdocs/almasi_c5/concrete/config/../blocks/flow_gallery/controller.php) [function.Loader-require-once]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/almasi_c5/concrete/libraries/loader.php on line 88
Fatal error: Loader::require_once() [function.require]: Failed opening required '/Applications/MAMP/htdocs/almasi_c5/concrete/config/../blocks/flow_gallery/controller.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php:/Applications/MAMP/htdocs/almasi_c5/libraries/3rdparty:/Applications/MAMP/htdocs/almasi_c5/concrete/config/../libraries/3rdparty') in /Applications/MAMP/htdocs/almasi_c5/concrete/libraries/loader.php on line 88


I installed imageflowgallery just fine, the menus show up to add images. Installed to blocks/imageflowgallery.

(Mac OS X, MAMP, Safari Browser)

** UPDATE **
so, i cannot figure out for the life of me where it thinks 'flow_gallery' is defined. I 'faked' it out for now by creating the directory and including a blank PHP file inside of that directory.
andrew replied on at Permalink Reply
andrew
Due to the way we're doing caching, the system will have the class for the controller BEFORE it even knows where to find this block. It then reverse engineers that path from the class. The rule is

MyCapitalizedTestBlockController = my_capitalized_test in the filesystem.

So for example, looking at the original attachment, the class was named imageFlowGalleryBlockController but the directory was imageflowgallery... I changed it to be FlowGalleryBlockController and changed the directory in the filesystem to be "flow_gallery" and it looks like it finds things fine.

There are some other issues with the block that I'm checking out...but installing it went fine at this point.
andrew replied on at Permalink Reply
andrew
To get it working completely, I had to modify blocks/view.php to point to "flow_gallery" in the filesystem instead of "imageflowgallery".

There's a better way of grabbing the "current directory" that you're in than hard-coding it to DIR_REL/whatever/.. unfortunately we could do a better job documenting it.

Instead of defining $blockTypePath the way that's done currently, try this:

$ci = Loader::helper('concrete/urls');
$blockTypePath = $ci->getBlockTypeAssetsURL($b);


$b is the block's object that's always available in the view template of a block... and the getBlockTypeAssetsURL function ensures that the correct path to the block is used...whether the block is added to the local install, the core concrete directory, or a particular application directory...

Nice block...very pretty. Cool approach to a gallery.
AndyB37 replied on at Permalink Reply
AndyB37
...I knew there probably was a more "dynamic" way of grabbing the block type directory - just couldn't figure out what it was.

I'm really enjoying this system and kind of wish that I was using it for more than just a hobby/family site.
xsastre replied on at Permalink Reply
First of all thanks for that wonderful product C5 and thanks fot that great contribution "the imageflow block"
My problem is that after selecting each of the files to be in imageflow block, it says "undefined" instead of the image's name (hypothetically). Anyway if I go on updating, the block only shows "loading images 0/0" messages and no images at all

How must I proceed?

Many thanks!!
AndyB37 replied on at Permalink Reply
AndyB37
I created this block as an adaptation of the slideshow block back when Concrete5 was at about version 5.1 or so. I haven't used it since then, and apparently there have been some changes to the core code that have rendered this block unusable. I don't have a whole lot of time to go in right now and figure out what to update to make it work with more recent versions.

If anyone does, though, I'd be interested to hear what needs to be updated. (I only got as far as figuring out that it has something to do with a change to the asset library interface.)
xsastre replied on at Permalink Reply
Thanks for your reply Andy. I will focus on your indications instead of carving all around.
As I'm a complete novice both on C5 and CSS, your indication is "a small reply for you and a giant leap for me" ;-)

Anyway, any further advise will be welcomed, as I'm preparing my first, let's say productive, site.

Many thanks
xsastre replied on at Permalink Reply
I've got it!!!
I'll try to post the modifications required in a few days, as I'm quite busy trying to go live my first c5 site :-)

Thanks for this amazing platform C5 and for this great block!
bryanlewis replied on at Permalink Reply
bryanlewis
The block seems to work great but after I add the image from the file manager the picture does not show up. It just simple states "undefined" is there a way to fix this?
advisorgee replied on at Permalink Reply
I'd be interested in seeing those changes if you can post them.
advisorgee replied on at Permalink Reply
I'd be interested in seeing those changes if you can post them.
advisorgee replied on at Permalink Reply
I'd be interested in seeing those changes if you can post them.
AndyB37 replied on at Permalink Reply 1 Attachment
AndyB37
I haven't had time to rework the entire block, but I did have a few moments to get it packaged up as an alternate view template for the core "Slideshow" block. I've attached the files - just throw the whole top level "imageFlow" folder into your "Packages" folder in the root level of your installation and then install it in the dashboard.

Since it's only a view template - all of the ImageFlow variables are locked in as constants. If you want to change any of them, you'd have to go to to the bottom of the "view.php" file and adjust the code there.

Also, I should mention again that I got this script from someone else and using it on commercial sites requires paying for a license. Check the link in the first comment in this thread to purchase that commercial site license.
icowden replied on at Permalink Reply
Hi Andy,

Do you have any plans to integrate this with a lightbox rather than just the plain old new page?

Iain
rich5 replied on at Permalink Reply
rich5
Is there a way to change the height of the imageflow content? normally in imageflow you can set the Aspect Ratio, but I couldn't find this setting within the config files?