Welcome, Guest. Please login or register.
Did you miss your activation email?
18 Mar 2010, 15:57

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: Lightbox - remove "click here" link and replace with image title  (Read 568 times)
0 Members and 1 Guest are viewing this topic.
amhoffmaster
Forum Members
**

Karma: 0
Offline Offline

Posts: 35


« on: 21 Dec 2009, 10:34 »

I've implemented the lightbox module (by Lokesh Dhakar) and it works fine. I'm using the tinyMCE editor.

The problem is that I can't figure out how to remove the "click here to save a version of this image" link and having the actual title of the image display in that spot.

Here's the page: http://www.bethel.nurelm.com/index.php?page=coffeecakes

I'm sure it's a simple fix, but I can't seem to find anything on the forums about it.

Thanks.
Logged
Peciura
Power Poster
***

Karma: 17
Offline Offline

Posts: 624

Location: Lithuania

Gravatar


« Reply #1 on: 22 Dec 2009, 09:44 »

1. Note, after this small hack don't expect any support from module developer.
2. Back up "/modules/LightBox/js/lightbox.js"
3. Locate function "updateDetails". It is on line 512 in LightBox revision 12 (the same as yours).
Modified function replaces link text "Click here to save a version of this image" with value of LightBox "title" attribute if available. Also it does not show picture title in it's default place.

Code:
updateDetails: function() {

// if caption is not null

download_text = 'Click here to save a version of this image';
if(imageArray[activeImage][1]){
// Element.show('caption');
// Element.setInnerHTML( 'caption', imageArray[activeImage][1]);
download_text = imageArray[activeImage][1];
}

// if image is part of set display 'Image x of x'
if((imageArray.length > 1) || (saveImage == true)){
Element.show('numberDisplay');
Element.setInnerHTML( 'numberDisplay', "Image " + eval(activeImage + 1) + " of " + imageArray.length + "<br><a target=_blank href=" + imageArray[activeImage][0] + ">" + download_text + "</a>");;
//Element.setInnerHTML( 'numberDisplay', "Image " + eval(activeImage + 1) + " of " + imageArray.length);
}

new Effect.Parallel(
[ new Effect.SlideDown( 'imageDataContainer', { sync: true, duration: resizeDuration, from: 0.0, to: 1.0 }),
  new Effect.Appear('imageDataContainer', { sync: true, duration: resizeDuration }) ],
{ duration: resizeDuration, afterFinish: function() {
// update overlay size and update nav
var arrayPageSize = getPageSize();
Element.setHeight('overlay', arrayPageSize[1]);
myLightbox.updateNav();
}
}
);
},
Logged

My best friends are: {get_template_vars}, {var_dump var=$entry}, {dump item=$entry}, {$entry|debug_display}, {$entry|print_r},
variable modifiers...showtemplate=false...module_customhow to create a patch?
And Yours ? Smiley
amhoffmaster
Forum Members
**

Karma: 0
Offline Offline

Posts: 35


« Reply #2 on: 28 Jan 2010, 11:29 »

Hi There,

Thanks for the direction on this. Just one more thing...I don't want there to be a link at all. The object isn't to have people download the photo...just see the title.

Any way to remove the link entirely?

Logged
calguy1000
CMS GURU - 2nd Tier Support.
Dev Team Member
Power Poster
*****

Karma: 154
Offline Offline

Posts: 4733

Location: Formerly in Calgary, Canada

Gravatar

Second Tier support


WWW
« Reply #3 on: 28 Jan 2010, 12:16 »

I don't suggest using the LightBox module for any further development.... fancybox addon to jquery is so much more powerful and easy to work with
Logged

Questions relating to my modules are answered to paying customers, or when I have the time and motivation to.
----------------
Don't make me angry..... you won't like me when I'm angry....
Follow me on twitter
Dr.CSS
Administrator
Power Poster
*****

Karma: 135
Offline Offline

Posts: 7723

Location: Arizona


formerly known as mark


WWW
« Reply #4 on: 28 Jan 2010, 17:51 »

I believe the call to not have a link is one of the variables you can set in the JS call...
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Right click and view source is a great way to see what you have to work with...
Not sure what ver. CMSMS, PHP, server OS, etc. look at the System Information page...
OK if you removed the default content read it here... http://multiintech.com/defaultcontent/
People are Wonderful... Business is Great... Life is Terrific
amhoffmaster
Forum Members
**

Karma: 0
Offline Offline

Posts: 35


« Reply #5 on: 09 Feb 2010, 09:12 »

Where might I find that call in the js? I'm not a programmer so you'll have to spell it out for me. The link is only thing I don't like about this method of enlarging the photos.
Logged
Dr.CSS
Administrator
Power Poster
*****

Karma: 135
Offline Offline

Posts: 7723

Location: Arizona


formerly known as mark


WWW
« Reply #6 on: 09 Feb 2010, 10:50 »

The link in first post is "page not found" I would have to see it to tell you how or if you can add the variable...
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Right click and view source is a great way to see what you have to work with...
Not sure what ver. CMSMS, PHP, server OS, etc. look at the System Information page...
OK if you removed the default content read it here... http://multiintech.com/defaultcontent/
People are Wonderful... Business is Great... Life is Terrific
amhoffmaster
Forum Members
**

Karma: 0
Offline Offline

Posts: 35


« Reply #7 on: 09 Feb 2010, 18:02 »

Sorry, content is being added and the customer is testing quite a few features.

Here's a new link: http://www.bethel.nurelm.com/index.php?page=coffee-cakes-2

Notice that when you click on the image, there's a brief description of the product...the link on the description is what I want to remove.
Logged
Dr.CSS
Administrator
Power Poster
*****

Karma: 135
Offline Offline

Posts: 7723

Location: Arizona


formerly known as mark


WWW
« Reply #8 on: 17 Feb 2010, 12:19 »

Most likely what is happening, since you are using tiny to do this is, a quote from the lightbox site,...

Can I insert links in the caption?
    Yes, but you need to convert quotes and greater and less than symbols into their html entity equivalents. For example:
    <a href="images/image-4.jpg" rel="lightbox" title="&lt;a href=&quot;link.html&quot;&gt;my link&lt;/a&gt;">Image</a>

I bet if you turn off tiny you will see the <  > turned into those &lt; &gt; like above...
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Right click and view source is a great way to see what you have to work with...
Not sure what ver. CMSMS, PHP, server OS, etc. look at the System Information page...
OK if you removed the default content read it here... http://multiintech.com/defaultcontent/
People are Wonderful... Business is Great... Life is Terrific
kazuking
Peanut Gallery


Karma: 0
Offline Offline

Posts: 1


« Reply #9 on: 04 Mar 2010, 17:22 »

I had the same issue and this is how I solved it.
The file to edit is \modules\LightBox\action.js.php
Content of this PHP is what gets inserted in place of {LightBox action='js'} in the template.
It has a lot of Code but the section that matters is...
Code:
<script type="text/javascript">
var fileLoadingImage = "%smodules/LightBox/images/loading.gif";
var fileBottomNavCloseImage = "%smodules/LightBox/images/closelabel.gif";
var overlayOpacity = 0.8;
var animate = true;
var resizeSpeed = 7;
var borderSize = 10;
var imgMaxWidth=800;
var saveImage=true;
</script>
I think it's self explanatory but in this case we just change the last variable "saveImage" to false.
You can change other options such as Maximum Width, animation, opacity, etc.
I hope this helps.

Logged
Pages: [1]
Print
Jump to: