Welcome, Guest
Username: Password: Remember me

TOPIC: Lightbox for image

Lightbox for image 20 Feb 2012 19:47 #1412

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Hi everyone,

I set modal preview for image. I would like to open this image by lightbox.
So I need to modify the link which opens the image. Do somebody know what file or what part of a file
I need to modify so that I can add: rel="lightbox"

<a href="example.jpg" rel="lightbox" title="something....

I also need to find correct folder where to put the js script for lightbox functionality.

many thanks
The administrator has disabled public write access.

Re: Lightbox for image 21 Feb 2012 10:44 #1418

  • iconvisual
  • iconvisual's Avatar
  • Offline
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
  • Karma: 1
Hi etc, I don't have the answer - however I would like to know if someone comes up with a suggestion.

Questions like this one are invaluable - even while outside the realm of j-cook they help us to extend the core functionality and usability.

Anyone care to kick in with a code snippet on implementing the Lightbox?

Regards,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.
The administrator has disabled public write access.

Re: Lightbox for image 21 Feb 2012 20:04 #1427

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
I tried to quickly see the coding, I think it has to do with dom/html/link.php. But I am not fully sure.
The administrator has disabled public write access.

Re: Lightbox for image 21 Feb 2012 22:22 #1428

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Yes in JDom, maybe not in link.php


I think maybe add a rel property in the img tag.

(JDom image.php)
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Lightbox for image 22 Feb 2012 11:08 #1430

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
I stated the link.php file because it only works if the REL tag is placed inside HREF link (tested without php, only on local).
Unfortunately the REL tag will show up in all links on the page.
Anyway, yet it does not work. Maybe the problem is where to correctly place css and js files of lightbox.
The administrator has disabled public write access.

Re: Lightbox for image 22 Feb 2012 12:29 #1431

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
If you say right for <a href='' ..> tag, so follow this :

link.php is NOT ONLY for images, so the best is to separate functionalities.


TODO :
<?php echo JDom::_('html.fly.file', array(
	'dataKey' => 'my_image',
	'dataObject' => $row,

// HERE (create the link)
	'preview' => 'modal',

//DEFINE HERE WHATEVER PROPERTIES FOR LINK
	'linkSelectors' => array('rel' => 'lightbox'),  //example
	...
								));
?>

(Please regenerate, I modified link.php and html.php to get this possibility)





Also possible to distinct the albums if you play with the groups of the grid.

The only difficulty is when you have pagination and you want to navigate in the lightbox through the items that are not present in that page. (You may instance them with hidden controls).

Not tested at all, and maybe not in your needs, but just to help users who wants to deal with that.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Lightbox for image 22 Feb 2012 20:39 #1436

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Works great, thanks a lot.
My plan was to open single pictures in lightbox and for this purpose it works as I needed.
Last Edit: 22 Feb 2012 20:40 by etc.
The administrator has disabled public write access.
Time to create page: 0.108 seconds

Get Started