I'm exploring Fast Gallery as a solution to my gallery needs. I like the way I can just put my images in a directory to create a gallery and have imagecache resize and crop according to my needs. So far it does almost everything I need. Kudos to the developers!

What I'm still looking for is the ability to either embed a gallery into a node (like Brilliant Gallery) OR have the equivalent of a gallery "teaser" where I can describe each gallery before the images are presented.

Is there some way to do either of these things using the current version and if not, are there any plans to add this type of functionality in the future?

Thanks for a great module!

Mlle. Yotnottin

Comments

ncy’s picture

i'll keep this in mind in the next code update i post (coming soon, i think ....).

there is a quick (hack-ish?) way to do this by just adding another block and calling the fast_gallery_page() function in it. i haven't used Brilliant Gallery, so i'd be interested to know the results. it'd basically take the whole Fast Gallery page and put it into a block node.

for gallery teasers, only captions are implemented right now. it takes the folder name and uses it as a caption. rapsli is looking into implementing selecting custom folder images, which might allow for an additional spot for teaser as well.

-nick

rapsli’s picture

I've heard of this concept embedding stuff in a node. Can someone just quickly explain, what it's all about?

mlle.yotnottin’s picture

Thanks for the pointer, Nick.

I tried calling "print fast_gallery_page()" directly from a php snippet but that didn't work. I got the standard error page telling me I needed to set up my configuration.

After looking through the code for fast_gallery_page() it looks like you are using Drupals "arg()" function to get passed arguments. After altering the function call to include the 2 parameters for selecting the gallery it now looks like this:
function fast_gallery_page($fg_path='', $gal_name='')

I also changed the "$ar_path" assignment from $ar_path = arg(); to this:

if ($fg_path == '' || $gal_name == '') {
    $ar_path = arg();
}
else
{  
    $ar_path = array($fg_path, $gal_name);
}

This allows me to embed a gallery into a node simply by calling it like this:

    <?php print fast_gallery_page('fast_gallery', 'SafariSeats') ?>

I'm not sure if this is the proper "Drupalish" way of accomplishing this but it seems to be working well so far.

Brilliant Gallery installs an input filter that allows the user to enter something like this: [bg|NameOfGallery] which will embed the specified gallery inline in the text.

This is far simpler and easier to use than the php snippet noted above and would make Fast Gallery more versatile if it had this capability.

Mlle. Yotnottin

rapsli’s picture

can you make a patch? So it's easier to test.

ncy’s picture

i think this wouldn't work with subfolders?

mlle.yotnottin’s picture

StatusFileSize
new2.13 KB

This is my first time making a patch so use with caution.

Mlle. Yotnottin

rapsli’s picture

Status: Active » Needs review

to be tested with subfolders.

ncy’s picture

Status: Needs review » Active

thanx for posting the patch.

it works for galleries with only a single level of hierarchy. if you have subfolders, then those subfolder links will take you to the Fast Gallery page instead of staying on the current one.

mlle.yotnottin’s picture

I didn't think of subgalleries since I'm not using them.

However, it looks like the parent gallery still shows an image and link to subgalleries. Clicking the link then takes me to the subgallery as usual. If I try to access a subgallery with "parentgallery/subgallery" this does not work. It does appear though that specifying just the subgallery like "subgallery" (without the parent) still works as expected.

I guess for this method to be generally useful for others the idea will need to be expanded on.

Mlle. Yotnottin

ncy’s picture

yea, part of it is actually a limitation in the current implementation. every folder is required to have a unique name, regardless of where it is in the hierarchy. that's why specifying just the subgallery like "subgallery" still works. it searches the database for anything contained in that folder.

we should be storing the entire paths in the database ...

ncy’s picture

recoded to store full paths to folder names.

also added functionality of adding "teaser" text for folders, as well as a custom folder thumbnail. just upload a JPG file 'folder.jpg' into the associated folder. the EXIF description is used as the teaser text.

check it here:

#329256: New Updated Version to 6.x-3.1-beta2 Completed and Posted Here

mlle.yotnottin’s picture

It's taken me a while to get back to this. It looks like the expanded teaser text isn't quite what I need either. It still doesn't give me a "handle" to access a gallery from other Drupal nodes.

I did however find a workaround that allows me to embed a fast gallery in a normal node and doesn't require any changes to the fg code. I used the technique described at http://drupal.org/node/83431 and added that code to a custom module I use for just such things and came up with this:

function get_fast_gallery($path) {
	$q = $_GET['q'];
	$_GET['q'] = drupal_get_normal_path($path);
	print menu_execute_active_handler();
	$_GET['q'] = $q;
}

When editing a normal node I can now add a small piece of php to display the gallery:

<?php get_fast_gallery('fast_gallery/galleryname');?>

which then gets added into the page when viewed. Except for a few small css issues this seems to be working out quite well.

Thank you for your work on this module. It now does just what I need.

Mlle.Yotnottin

ncy’s picture

Status: Active » Fixed

nice! thanks for sharing the tip :)

rapsli’s picture

Status: Fixed » Active

@mlle.yotnottin: Can we get this into the module just like this? ... Right now I don't got much time to look at this more closely.

mlle.yotnottin’s picture

I'll take a look at it and see what I can come up with. It seems it would be best to implement this as an inline filter tag/token as opposed to a function call like I'm using it now. Also, this method looks like it may have some security issues such as lack of access control and parsing for malicious intent.

I'm pretty tight for time as well but I'll see what I can do.

Mlle.Yotnottin

rapsli’s picture

I think an inline Filter would be great.

mlle.yotnottin’s picture

StatusFileSize
new2.65 KB

I found a few minutes to work on the filter tag this evening and came up with the attached patch based on code found in several other modules.

This code is based on the 6.x-3.2-beta1 version and creates a filter called "Fast Gallery Tag" that can be enabled on the "admin/settings/filters" page for an input format. Once enable, it can be used within a node in the form "[fg:galleryname]". The tag is then replaced with the requested gallery at the position of the tag in the text.

I have not performed any extensive bug testing so use with caution. There is a lot of room for improvement but this should provide a starting point in this endeavor.

Mlle.Yotnottin

rapsli’s picture

Assigned: Unassigned » rapsli
Status: Active » Needs review

Let's get this into 3.3

http://www.schaerwebdesign.ch

rapsli’s picture

Status: Needs review » Fixed

committed to head. Makes testing easier.

verikami’s picture

subscribing :-)

rapsli’s picture

it's already in the dev version: [fg:galleryname] not well tested yet though.

verikami’s picture

how to get this dev...?

could it be located @: http://drupal.org/project/fast_gallery

rapsli’s picture

weird... there should actually be a link to the dev version...? here is the link to the CVS http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/fast_gallery/

verikami’s picture

after some training (and doc. reading) I figured how to get it from command line:

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d fast_gallery contributions/modules/fast_gallery

...it's really cool & it works :-)

Mamouri’s picture

I downloaded the latest version from CVS and enabled the Filter. But it didn't work for me. I have a folder named "gallery1" in my gallery. the text [fg:gallery1] didn't replace with anything. Could you please help

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

_craig’s picture

Version: 6.x-3.1-beta2 » 6.x-4.0-beta2
Assigned: rapsli » Unassigned
Status: Closed (fixed) » Active

Perhaps I'm missing something, but I think this feature was lost in 6.x-4.0-beta2?

rapsli’s picture

did get lost??? I had to do a little fix too. Seems weird, but works on my local system. Check out the latest dev to see if this fixes your problem.

rapsli’s picture

Status: Active » Fixed
_craig’s picture

Looks like it's working in 6.x-4.0-beta3.

Nice module! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

j4’s picture

Rapsli,

Please does this work? After a lot of trials I finally have fast gallery working and it is so perfect for my needs that i dont want to give up!! :-( I really need the inline filter to work. I have the 6.x4.0-beta7 version. Can you please tell me whether the inline filter works or not?

Thanks a ton
Warm regards
Jaya

jeffschuler’s picture

Yes, the filter works in 6.x-4.0-beta7.
Follow the instructions in comment #17.

Unfortunately, once you use the gallery pager, you navigate away from your node...