Home Email RSS Feed

Lightbox JS v2.0 Integration with Blogger Template

1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 4.82 out of 5)

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Create a simple Photolog using Blogger.com and Lightbox JS. A step by step guide for photo bloggers; to Integrate Lightbox with their existing Blogger publishing system.

Blogger is a popular weblog publishing system, which supports custom designs and templates. Meanwhile Blogger is not much popular as other blog publishing system like WordPress, etc for its support to Plug-ins. In other hand Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It is lightweight and works with most of the browsers with Javascripts enabled.

Yesterday, I was trying to publish my own Photolog. I was looking for a good web serice so that it would ease my task. I am with Blogger for a quite time and still I have not moved my blog to WordPress, even I wish so. So I decided to go with Blogger again with the FTP publishing enabled. But blogger didn’t have any ready made plug-in for Lightbox so I had to hack the code little bit. Blogger with Ligthbox would give any blog a realistic Photolog look.

Step by Step Guide:-

1. Download the Lightbox JS script from Here and copy the scripts to your web server most likely where your blog is been published.
2. Login into Blogger system and go to Template –> Edit HTML
3. Add the below line into the Meta section of HTML tag
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen">
4. Add the following scripts tag in the header section of the HTML template
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
5. Check the CSS and make sure the referenced prev.gif and next.gif files are in the right location. Also, make sure the loading.gif and close.gif files as referenced near the top of the lightbox.js file are in the right location.
6. Once you’re done Save the Template.
7. With Blogger, we will not able to tweak their system directly, since it is not open source software. So we need to have little manual effort every time before you publish a photo log entry.
8. After creating a blog entry in Blogger system, do the following steps before publishing.
9. Go to Edit HTML option in the Post window as show in the figure 10. Once you have uploaded the image you will see an entry similar shown in the figure below.
11. Replace the selected code above with rel=”lightbox” as shown below12. You can also add title tag in tag to enable Caption in the LightBox displayed
13. Now you’re all set and you can publish your Photolog.

If you like to have image sets for each post entry then you need to add rel="lightbox[group_name]" for all the images that you which to show in that particular group image set. It should be similar to the below image.
Now you have a wonderful Photolog to start with as I do; Visit my PhotoLog at The PhotoLog

Popularity: 14% [?]

Tags: , , , , ,

1.

Arpit said,

December 20, 2006 @ 6:10 am

hello came to your blog thru JohnTP blog..
you seems to be intersted in technorati fav exchange.
Can we exchange technocarti fav?
If yes, add my blog to your technocrati fav and drop a msg on my blog, and i will add you in my technocrati fav
Thanks
Arpit
http://technicalbliss.blogspot.com

my technocrati username is arpitagarwal82

2.

THE MALE DIVA said,

December 31, 2006 @ 12:15 pm

apparently i am doing something wrong… its not working for me…

3.

Graduation said,

February 6, 2007 @ 4:14 pm

yeah me neither, please help, when i click on the image it loads at the bottom of the page

4.

benedict herold said,

February 6, 2007 @ 4:32 pm

Hey… guys.. give me the URL which you’re running the test site… Have a look at my site… http://www.benh.org/photolog/index.html

5.

Rasa Malaysia said,

May 5, 2007 @ 3:59 pm

Thanks for your great tips, I tried your tips and it seems to work well, only for one problem. Now, on my post, the image I uploaded is no longer center-align, but align to the left of the main post window, can you please help?

Here is my sample post: http://www.rasamalaysia.com/20....._test.html

Here is the HTML code of my post:

Homemade biscuits, Red Lobster style.

6.

benedict herold said,

May 5, 2007 @ 10:32 pm

hey.. I checked up your site.. I was not able to check in much detail, since the image you uploaded is not available anymore in your site. can you update tat.

7.

Yiannis said,

June 3, 2007 @ 11:14 am

I want to embedded the Lightbox JS script into an image into my blog (blogger.com).But i can’t find how to execute the first step

>
Where exactly in my blogger.com ?
Can you help me …
Thanks.

8.

benedict herold said,

June 4, 2007 @ 10:19 am

hey, if you’re running new blogger then here is what you need to do.

Goto Settings — > Template –> Page Elements
Add HTML/JavaScript page element into your blog. Paste the Java Script there. Now you’re all set. Now you follow from step 5. Let me know if that helped. !

9.

priya said,

July 27, 2007 @ 1:52 pm

For some reason its not working and need your help.

10.

benedict herold said,

July 27, 2007 @ 2:00 pm

priya – Sure, I would contact you. Will try to set that up for you.

11.

priya said,

July 29, 2007 @ 1:55 am

Ben,

Thank you for your help and it works great.

12.

benedict herold said,

July 29, 2007 @ 2:42 pm

Priya – I’m pleased to hear that :-) Good luck and thanks for the credit :-)

13.

Jayson Ang said,

August 10, 2007 @ 2:40 am

hello benedict,

i’m using blogger, using a free account …
how do i actually upload the lightbox css files to blogger?

Thanks in advance …

14.

benedict herold said,

August 16, 2007 @ 8:28 am

Jayson Ang- That is the limitation of Blogger account. You would not be able to do that. Instead you have to depend on third party hosting. You can use Google Pages for uploading the files for free. Hope this helps.

15.

James G. Vaccari said,

September 20, 2007 @ 10:04 am

Hi Benedict,

I try your tutorial, and it works very well… I just have one problem. When I click to go to the next page (I have five posts in each page), the lightbox in the next page does not work anymore. Have you seen this?

16.

Gratton said,

September 26, 2007 @ 2:03 am

Hi Benedict,

Thanks for your great work! I have wanted this feature for some time and have made time to get it done. I followed your tutorial carefully and consider I have placed the code segments in the correct places however, my test image still loads in a new page :(

I loaded the .js and .css files in GooglePages and edited the image (and other) links where required, and changed the URL references in your code to correspond to these file paths.  Can you see what I have done wrong?  Your help will be appreciated.

17.

Gratton said,

September 26, 2007 @ 2:58 am

Hello Benedict – I posted a comment earlier today … now it's gone. I followed every step of your guide, but my test image still loads in a separate page.  Can you help please?

18.

Matt said,

October 3, 2007 @ 11:42 am

Hi Benedict, Many thanks for this article, I've been trying to add lightbox to my blogger account for a while and followed the steps but my photos don't load – instead the lightbox loads but without anything in it.

Please help if possible.

20.

chad said,

November 6, 2007 @ 11:42 pm

benedict,

when i try to post an image and use the lightbox feature, it starts to work, and then my image loads at the bottom of the page.  i can tell that it's almost there, but this seems to be a problem some people have had…i think it has something to do with this "rel=lightbox" feature.

could you help me out?

thanks,

chad

21.

Shane said,

January 8, 2008 @ 10:51 am

Hi.

I’m also trying to get the light box up and running. As far as i can tell I have followed all the instructions correctly and the lightbox works for pages hosted on my site alongside the js files and css but when i try to do it in Blogger clicking on the link takes me straight to the link location. I’ve had a look at the source code for a couple of functioning pages (e.g. Benedict’s page) and noticed that one of the lines looks as follows:

if i try to copy that into my own template (changing the urls to point to my own site) i get an error message from blogger saying that the xml is not well formed. Ive tried tinkering with the ” and while there are no error messages then the light box does not work. Any suggestions on how to add this line to Blogger in such a way that it doesn’t cause errors? Thanks in advance.

Shane

22.

hussain said,

March 12, 2008 @ 9:07 pm

Could you please help me with integrating lightbox V2 for blogger xml template..

23.

claude said,

March 16, 2008 @ 6:40 pm

Hi Ben,
I tried the newest lightbox js and made it work so far… BUT:
my blogger-pictures are automatically saved to the blogger-server on an adress starting with http://bp0.blogger.com…. and nothing happens. the script is loading for hours without displaying anything, not even the size of the pic. if the picture I want to display is refered on a usual http://www... adress everything is fine.
Any suggestions?

24.

claude said,

March 16, 2008 @ 7:16 pm

funny, found the answer myself!
if anyone else interessed: the new blogger server bp0.blogger.com transfers yor pictures to websites! they cant be displayed by lightbox.
solution:
in the url of the picture (which is actually a website) is always ending like this : /s1600-h/your.jpg remove the -h and everything is fine!
phew!

25.

azurein said,

April 20, 2008 @ 2:06 am

how exactly do you “copy the scripts to your web server most likely where your blog is been published.” I can’t go through the next step since i don’t know how i’d copy the scripts to blogger

26.

ashr said,

April 29, 2008 @ 11:52 am

Thanks Benedict for this post. Thanks Claude for helping with the -h thing :) Works like a charm now.

27.

Jomjo said,

June 23, 2008 @ 3:54 pm

It’s all very nice, but how is it that most of the bloggers that have tried to do this can’t make it work?
I’ve made it work in my server homepage. In blogger, referencing the code to the same server… impossible!
Tried the code in many positions in the html blogger template. It blocks the page from being loaded.
Tried it (the js part) in a page element of the layout… the links for the images died, they don’t even open anything.
So… how is it that those that have managed, simply don’t explain how they did it? Where does the code go? There’s no meta tag in webblog. Where in the header section and how to present blocking? Now that would be helpfull …

28.

Snowcovered said,

July 1, 2008 @ 4:53 pm

YES! AFTER 2 NIGHTS! LIGHTBOX BLOGGER FIX:
Blogger has changes tha paths for images thats uploaded.

Solution:
If you have a path like this;

http://bp2.blogger.com/... /s1600-h/Image.jpg

remove “-h” in “/s1600-h/” to look like this, /s1600/

That did the trick for me anyway.

From:
http://www.geckoandfly.com/200.....ment-67353

29.

jim h said,

July 17, 2008 @ 12:15 pm

Unfortunately you can only do this if you’re using Blogger’s FTP publishing method. And if you use FTP you can’t use their new templates. Sigh.

30.

JonnyRRawr said,

September 4, 2008 @ 8:29 am

Thank you Benedict, for posting. I followed your steps, and it kinda worked- lightbox would activate, but I would be stuck in loading.

I read the comments and took off the “-h” off of /s1600-h/” and it works now!

31.

kestutis said,

September 27, 2008 @ 4:54 pm

hello, i tryed your how-to lightbox manual. I can’t upload your template. Blogger drop’s this one ->> “Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup.”

Please help me with it, thnx

32.

maw said,

October 8, 2008 @ 12:46 pm

hi, i followed your directions for lightbox but it isn’t working. can you help? i posted an image but when i click on it nothing happens.

thanks in advance.

33.

ecommerce website development said,

October 21, 2008 @ 8:32 pm

Please visit my tutorial too :http://www.virtuosomaster.com/tutorials/how-to-setup-lightbox-blogger-template/

34.

Chad said,

November 28, 2008 @ 1:33 am

Hi,

Tried it, but it did not work. Like to find why. Please inform to get it to work. Thank in advance.

http://chadtat.blogspot.com/

Chad

35.

del.icio.us links for January 25th | Elastic Minds said,

January 26, 2009 @ 3:55 am

[...] TechCorner » Lightbox JS v2.0 Integration with Blogger Template – [...]

36.

Adlan said,

January 29, 2009 @ 9:42 pm

Hi,

I already did like what you’ve shown on the example, but it’s not working.thank you

37.

Maciej M said,

February 3, 2009 @ 7:48 am

Is it possible to attach lightbox from external server? I’ve tried and it didnt work.

38.

Jason Andrew Bowles said,

February 10, 2009 @ 2:06 pm

I have proofed multiple times and can find no errors, but it will not work. I am wondering if there is js running that is interfering with lightbox.js?

If anyone has the time to check it out, it would be most appreciated.

First photo on the page….http://www.jasonandrewbowles.com/search/label/Sculpture

39.

ben posch said,

February 14, 2009 @ 10:21 am

hi ben, i have a problem with lightbox on blogger i cannot find an answer to anywhere on the internet (i admit i am a little bit of a caveman when it comes to programming, so i’m sure you will be insulted by my sloppy code. sorry).

i have lightbox2.04 running on my blogger blog, located at benposch.com. problem is, lightbox doesn’t appear to work when you view the permalink entry page, only when you’re on the main page. the second entry “lightbox test” is the only place i have it right now, so you can see what i mean.

it seems like you know a lot about using this so i am hoping you can help me. thanks, and very nice site by the way! ben

40.

ben posch said,

February 14, 2009 @ 10:35 am

sorry, i’m an idiot. didn’t check to see that the original code had absolute links asigned to the js and all that. sorry, disregard that last post. duh. ben

41.

Piyush said,

March 4, 2009 @ 8:29 am

Hi benedict herold

i saw you blog
http://www.benh.org/photolog/index.html it shows fullscreen images. i how can i get i working my blog http://www.majhyalekhnetun.blogspot.com.
i am using large image but it is still displaying small preview of it.
how can i make is full screen or at least big image?
thanks. waiting for you reply

42.

Jonathan said,

April 10, 2009 @ 9:12 pm

Wondering if the publisher of this is still around… He kinda got people started and left…like a long time ago too I see.

43.

Aishwar said,

April 21, 2009 @ 10:17 pm

Hey,

I have created an easy to implement solution to the above issue – so that you don’t have to click “edit html” for each image you add. Its not lightbox itself, but something similar.

You can check it out here AiBloggerBox

I am developing the next version now which will automate lightbox integration itself. Features such as grouping images are unavilable, but otherwise it gets the job done. Do check it out!

Hope someone finds it useful.

44.

johanhendrix said,

May 13, 2009 @ 10:21 am

the gallery is located inside an iframe.
i want the picture to show on top of the main page and not inside the iframe.
how do i fix this?

45.

manoz said,

May 20, 2009 @ 4:51 am

this doesnot work because this idea is for blogger who are hosting the pages by themselves not by blogger. After hosting blog by own, nobody has to teach daddy to put things in blogger.

46.

Elijah G. said,

May 24, 2009 @ 9:18 pm

Hi, if your images are loading at the bottom of the screen it means your lightbox.css file is not being accessed, referenced, or used.

The lightbox.js script generates html which is added to the bottom of your blog’s html when it is executed, but it is the lightbox.css which overlays the image inside the lightbox container and fades the background with an opaque filter. Make sure you have uploaded lightbox.css to the right location and that you have the tag correctly formatted and inserted in the section of your blog’s html.

47.

Luis Felipe said,

June 22, 2009 @ 6:27 pm

It worked, you can view it here
http://elbloghd.blogspot.com/2.....e-las.html
Click on the cat xDD

RSS feed for comments on this post · TrackBack URI

Leave a Comment