Embed Fast Gallery in node?
mlle.yotnottin - October 29, 2008 - 19:38
| Project: | Fast Gallery |
| Version: | 6.x-4.0-beta2 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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

#1
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
#2
I've heard of this concept embedding stuff in a node. Can someone just quickly explain, what it's all about?
#3
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
#4
can you make a patch? So it's easier to test.
#5
i think this wouldn't work with subfolders?
#6
This is my first time making a patch so use with caution.
Mlle. Yotnottin
#7
to be tested with subfolders.
#8
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.
#9
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
#10
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 ...
#11
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
#12
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
#13
nice! thanks for sharing the tip :)
#14
@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.
#15
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
#16
I think an inline Filter would be great.
#17
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
#18
Let's get this into 3.3
http://www.schaerwebdesign.ch
#19
committed to head. Makes testing easier.
#20
subscribing :-)
#21
it's already in the dev version: [fg:galleryname] not well tested yet though.
#22
how to get this dev...?
could it be located @: http://drupal.org/project/fast_gallery
#23
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/
#24
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 :-)
#25
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
#26
Automatically closed -- issue fixed for two weeks with no activity.
#27
Perhaps I'm missing something, but I think this feature was lost in 6.x-4.0-beta2?
#28
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.
#29
#30
Looks like it's working in 6.x-4.0-beta3.
Nice module! Thanks!
#31
Automatically closed -- issue fixed for 2 weeks with no activity.
#32
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
#33
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...