Home Email RSS Feed

Lightbox JS v2.0 Integration with Blogger Template

1 Star2 Stars3 Stars4 Stars5 Stars (9 votes, average: 4.78 out of 5)

If you've enjoyed this post, you might want to subscribe my RSS feed or email alerts for free updates. Thanks for visiting and come back again.

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

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.

RSS feed for comments on this post · TrackBack URI

Leave a Comment