Add nolink attribute to G2 tag
westphal - July 9, 2006 - 01:49
| Project: | Gallery |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
It would be nice to be able to use the [G2] tag to include an image from Gallery2 in my Drupal pages and not have it link to the item in the gallery. Could this be accomplished using something like [G2:98 nolink].

#1
gallery.module gets its info directly from the ImageBlock module in Gallery2. It is there that the option is required. Could you please add this feature request on the GMC website.
#2
I will do that. Thanks.
#3
Also interested in this feature. I found a request for it & a cool patch on Gallery that adds a link target to the imageBlock code - It was from awhile ago, and recently committed to the CVS version of Gallery, but didn't make the 2.1.2 release. http://gallery.menalto.com/node/37926
It supports no link, a specific link, or defaults to the link to the gallery image.
I think all that is needed is to modify the filter [G2:itemID link=....] and we're in business. Is the person who wrote that filter still on this? Would be great to have them look at it, I'd be willing to pay them for their time.
Thanks,
-greg
#4
I'm not adept at rolling patches. However, attached is my modified filter.inc, I also added the form elment below to gallery_settings.inc
$form['filter']['gallery_filter_default_link'] = array('#type' => 'textfield',
'#title' => t('Default Link'),
'#default_value' => variable_get('gallery_filter_default_link', 'none'),
'#size' => 50,
'#maxlength' => 100,
'#description' => t('Enter a link target (eg "none", blank defaults to gallery).'),
);
Using the CVS version of Gallery (or at least incorporate the imageBlock Module updates - this is what I ended up doing - didn't want CVS code on our production server). Can use the image filter with the new parameter link="..."
link=none (my default)
link=blank & filter parameter set blank (image links to url for full size in Gallery)
link="http://www.drupal.org" (image links to specified url)
Have this in a production environment at the moment, and seems to be working fine.
#5
I am a little bit confused as to how to go about doing this. What is it that you need to modify exactly? I couldn't find any files by the names mentioned here.
#6
Added in the 5--2 branch. Needs G2.2 or above.
#7