I've learned that you can use the Lightbox effect with Asset from this thread.
A bit of background: I'm switching to Asset from using Image and Image Assist as I want a single way for users of my site to upload images, docs, etc. I like it's simplicity. Since my site will be rather asset heavy (we're an archaeological charity with lots to say) it looks perfect.
wmostrey gave this info to my request for information on how to make it work:
Wessex, if you have the lightbox script as a directory in your current theme (so sites/all/themes/mytheme/lightbox) it will automatically be used, you don't need to change anything.
I don't use themes this way - I have only one site, so I just use /themes
I downloaded Lightbox 2 from http://www.huddletogether.com/projects/lightbox2/ and put the whole "lightbox" folder in /themes/litejazz/ so my path was /themes/litejazz/lightbox (Is this way of installing themes bad practice?)
I then went to a new page and uploaded a new image using the Asset wizard, and couldn't spot anything that would give me an option to use lightbox with an alternative or derivative image.
Have I completely missed something here? I suspect that I have...
If I can get this working I might see if I can produce some documentation.
Comments
Comment #1
wmostrey commentedThis is something that's on my short-term todo: integration with the lightbox module.
Apart from that, it is indeed bad practice to install contributed themes in /themes (or contributed modules in /modules). They belong in sites/all/themes or sites/yoursite.tld/themes for instance. Now asset uses path_to_theme() so no matter where your theme is located, it should find the path. Could you look at the html source and see what lightbox js files it's trying to add? If you could paste that here, that would help me debug.
Comment #2
wessex commentedwmostrey - thanks for the tip about the correct place to put themes. My theme (Litejazz) is now installed at /sites/all/themes/litejazz
So the path to Lightbox is /sites/all/themes/litejazz/lightbox
In the source to a normal node page nothing is inserted that relates to Lightbox at all. In the Asset popup, there is also no code relating to it either.
(I'm using the latest dev version from 23 Feb)
Sorry I can't provide anything definite for you to debug!
Comment #3
wmostrey commentedHey wessex, I'm not sure if I understand what the error is you're getting. Could you tell me what the behavior is you're experiencing and what the expected behavior is?
Comment #4
wessex commentedOK - I'll try and explain as simply as I can :-)
I would like to be able to use Asset to upload images. Sometimes, I'd like to be able to view a larger version of an inline image using Lightbox. I read on another thread that Lightbox functionality was included in Asset. But I have no idea how to use Lightbox using Asset's popup interface.
You said that in order for Lightbox to work, I needed to put Lightbox into my theme directory.
I have done this, but don't know how to actually *use* it.
I would expect that I could upload two images, a large version to use in the Lightbox and a smaller version to use inline. Asset would link the two images together and insert "rel="lightbox" for me. If I could upload one image and GD/ImageMagick could resize the image automatically (as defined in Asset's settings page) it would be utterly joyous (as per the functionality of the Flexible Upload WordPress plugin - http://blog.japonophile.com/flexible-upload/ ).
Comment #5
wmostrey commentedWessex, if you have the lightbox directory in your theme, the functionality works automatically (although there's a noted bug for lightbox with cck assets). There's no need to upload two images, you can use imagecache instead. The imagecached thumbnail will have a link to the lightboxed original image.
Comment #6
wessex commentedAh - so imagecache is the missing link. I'll give it a try.
Thanks!
Comment #7
1kenthomas commentedLooking at the code, asset will not autodetect the version of lightbox you installed if you unpack it into /lightbox, because lightbox.js will wind up in /lightbox/js/lightbox.js
Regardless, I do not see lightbox added EVEN IF lightbox is present in the directory... therefore about to hack...
Comment #8
1kenthomas commentedForcing the check a l. 338 to TRUE does embed the correct ccs/scripts BUT does not produce a functioning lightbox for me. Will experiment more tomorrow. UPDATE: Latest download of lightbox expects different directory positions than asset code, ...reworking... STILL does not function when updated to new locations....
Wessex, were you able to get working?
Comment #9
1kenthomas commentedUPDATE2: I could not get this to work with the version of lightbox2 distributed above under any conditions.
Therefore I installed the lightbox2 module, which works with imagecache.
1,2,3.... works with views of image assets (perhaps with the help of the patch from the other lightbox thread), I haven't uninstalled that to test.
More later.
Comment #10
wmostrey commentedKenneth, do you have more information on this? How are things going?
Comment #11
wmostrey commentedIt would be great if all works should be put in #208027, it has done a lot of work on this already.
Comment #12
1kenthomas commentedHaven't had time (yet) to check with the changes in asset. Will review the above and attempt summary... in the next week where I average above six hours of sleep per day :)