Can't get Lightbox to work with customized Matrix, Gallery 2
|
afterdark
Joined: 2008-09-10
Posts: 56 |
Posted: Mon, 2009-10-19 20:13
|
|
Quote:
Gallery version = 2.2.5 core 1.2.0.7 I'm trying to make my embedded gallery page work with lightbox. I'm following this tutorial but am hitting 2 problems. 1. When I add the stylesheet and js lines (point 8 on the tutorial) it totally screws my final page (big black square over top half of screen and a permanent empty lightbox box at the bottom). It's like the lightbox stylesheet and my own stylesheet are clashing. I tried including the lightbox stylesheet contents at the bottom of my own stylesheet but the same thing happened. I'm really in the dark on what I'm doing here. You can see the mess I've made here (it should be a 3x3 thumb grid!) 2. Even with the above page-wrecking lightbox stylesheet in place, the actual functionality isn't working. When you click thumbnails it still loads the gallery HTML page of that image, not the lightbox version. In the tutorial (point 10 and 11) the 2 lines of code it advises to replace seems a little out of date: <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}"> the code in my Matrix theme is: {capture assign=linkUrl}{g->url arg1="view=core.ShowItem" I changed it to: and for the second link: {g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="Lightbox[gallery]"} But it didn't work. I've no idea if the syntax is right, I was just using my best guess. Any help on this would be muchly appreciated. |
|

Posts: 56
bump - anyone, please?
I'm kinda really stuck with this one.
Posts: 22883
Perhaps the tutorial was not written for your version:
Either way you should upgrade as there is security and other bug fixes sine then.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
OK, am about to brave an upgrade - just a bit puzzled on doing backups.
I've backed up the database via phpMyAdmin and have an sql file and a zip of the sql file.
Do I need to back anything else up - eg the photos and themes?
Is this just a case of downloading my 'gallery' folder from my webserver to my local drive via ftp?
Posts: 22883
Yes
That will work but might take some time. Don't forget the g2data folder and all the hidden files ( they start with a dot ).
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
What would be a quicker way?
I'm on a Mac. If there's some line I can type into Terminal to zip the whole site up, I imagine that'd be better than downloading as OSX will just hide all the hidden files as soon as they hit my HD.
Posts: 22883
http://codex.gallery2.org/Gallery2:FAQ#How_do_I_backup_G2.3F
Yes if you have some utility to zip up the data it will go faster.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
Think I've got it all backed up - are there likely to be any other hidden files other than .htaccess I should check for?
Posts: 22883
Not that I can remember. Some people miss the versions.dat file int eh g2data direcotry.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
I've copied the unzipped gallery 2.3 onto my server ready to run the installer.
I'm currently using a custom theme (a duplicate of Carbon, renamed) in my gallery 2.2.5 version - should I copy that renamed theme folder over to the new 2.3 folder before running the installer?
Posts: 22883
If your DB on the old install was using a theme then the new location needs it as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
Ok, I'm at step 4 of the installation. It's saying to pick a g2data folder with a random string appended.
Do I point it to my old g2data folder which includes a random string (currently sitting in my original gallery directory, now called 'gallery_old'), or do I need to copy that g2data folder to the new 2.3 folder?
Or do I need to let it create a whole new g2data folder with a completely different string?
...oh, and regarding the modules installed, I additionally had things like watermark and imageframe installed with custom graphics - should I just copy those folders over to the new 2.3 modules folder, or do i need to reinstall them via the site admin?
Posts: 56
any help on this appreciated. I know they're the stoopidest questions, but I don't wanna mess this up! Ta.
Posts: 22883
I'm a bit confused as to why you are running the installer and not the upgrade?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
I didn't realise there was a difference! I followed the instructions here http://codex.gallery2.org/Gallery2:Download#Upgrades which say to download, unpack and go to your gallery site. When I went there it automatically starts the installer.
Anyway, I changed the url to inlcude '/upgrade' and found the upgrader.
I've run the upgrade but ran into errors at 'Upgrade Plugins'.
This was the stack trace it threw out:
At my gallery website I now just get a page saying an error occured (http://afterdarkmodels.com/gallery)
I think it may have had problems with missing files for Ajaxian, Carbon and Matrix theme, though I don't remember deleting any files.
What should be my next step?
Posts: 22883
Does this file exist? If not replace it with the files that you got from the download page.
FAQ: How can I make sure that my installation files are all intact?
Warnings about missing or modified files should not be ignored.
You might have to deactivate the image frame module manually:
FAQ: How can I deactivate a module when I am unable to login?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 56
Thanks, seems a couple of folders got missed in the FTP. Upgrade now successful.
I'm still left puzzling over the Lightbox problem though.
I realised what the clash was in point 1 of my first post. It was coz I'd left a few Lightbox script calls in the head of my page (it was butchered from another page). Also, I didn't realise you had to download a G2 Lightbox module till I read right to the bottom of the instructions. That's now d/l'd and installed.
But point 2 of my first post remains. The code I'm advised to change has different syntax to the latest Carbon theme code.
It says to find the two lines in album.tpl that contain this:
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
Those lines now looks like this:
{capture assign=linkUrl}{g->url arg1="view=core.ShowItem"
arg2="itemId=`$child.id`"}{/capture}
and:
{if $theme.params.dynamicLinks == 'jump'}
{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}
{else}
It says to replace it with this:
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="Lightbox[gallery]">
Which I've interpreted as:
{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem"
arg2="itemId=`$child.id`"} rel="Lightbox[gallery]{/capture}
and:
{if $theme.params.dynamicLinks == 'jump'}
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"} rel="Lightbox[gallery]
{else}
Anyone know if my syntax correct, coz the page just sits there? No Lightbox functionality at all.
Posts: 4338
Aside from anything else, it looks like you're missing two "-marks, at the places indicated by *.
You should be able to examine the html of the page in your browser and see if what is being sent looks like sensible html or not.
Posts: 56
Thanks alec, have amended that, still no joy though.
In Point 8 of the instructions (http://codex.gallery2.org/Gallery2:Modules:Lightbox#Basics) it says to include a few paths to the js files in the head of templates/theme.tpl.
I've been working in a copied theme.tpl file in a 'local' directory within the theme's templates folder, so does that mean the paths to the js files need altering too?
Posts: 56
Yay... finally managed to get Lightbox to work by taking pieces of script from this guy's examples and pasting it into my theme.tpl and album.tpl
http://www.chavers.us/content/view/21/42/
Took many attempts and much guesswork but eventually sorted it.
)))
Posts: 22883
Glad you got it all sorted.
Perhaps you can post the files that you changed to benefit others.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team