Forums

[resolved] Exhibit - lightbox integration (3 posts)

  1. Michiel
    Member
    Posted 4 years ago #

    Hi,

    For those of you still using Exhbit, this is how you make it work with Lightbox... big thanks to the code from Miro123!!! I added the lightbox[GROUP] code and some more instructions. Lightbox works nicely per post!

    This is a followup from http://wordpress.org/support/topic/95433 which is quite messy.

    1. download Lightbox and put the folder with the javascript somewhere in your server and refer to it in your header. Just add the following lines to your header.php, before the </head> tag:

    <script type="text/javascript" src="http://www.website.org/js/prototype.js"></script>
    <script type="text/javascript" src="http://www.website.org/js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="http://www.website.org/js/lightbox.js"></script>

    2. Add the Lightbox CSS. I copied everything in lightbox.css and just pasted it at the end of my WordPress stylesheet. You could also add a line in the header as suggested in the Lightbox docs:

    <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

    3. Upload the Lightbox images folder (I put it in the root folder)

    4. You should test it by manually adding a Lightbox link in a post to see what happens. Such as (from the Lightbox docs):

    <a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a> or better, try two or more images and putting them in a slideshow, like this:

    <a href="images/image-1.jpg" rel="lightbox[slideshow]">image #1</a>
    <a href="images/image-2.jpg" rel="lightbox[slideshow]">image #2</a>
    <a href="images/image-3.jpg" rel="lightbox[slideshow]">image #3</a>

    If this works then you're nearly there.

    5. Here's the trickier part. Edit the /wp-content/plugins/exhibitimg/exhibit10p.php file.

    5a Around line 346 there is the following:
    global $exc, $page;
    Add on a next line the following code;
    global $post;

    5b Then around line 371 you find
    $ret .= "<a href=\"{$imgurl}\" onclick=\"exh_popImage('{$imgurl}', '".addslashes($image->caption)."'); return false;\">";

    Change it to:
    $ret .= "<a href=\"{$imgurl}\" rel=\"lightbox['.$post->post_name.']\" title=\"".addslashes($image->caption). "\">";

    6. Edit the /wp-content/plugins/exhibitimg/exhibit10.cfg and make sure you have the uber popup on false (around line 202)
    uber_popup=false

  2. Emanon
    Member
    Posted 4 years ago #

    Nice!

    I'm probably moving off Exhibit anyway, but since I've yet to find a decent solution I might still try this out.

    Thanks for sharing.

  3. sandrapan
    Member
    Posted 4 years ago #

    hi, i was wondering what is the exhibit?

Topic Closed

This topic has been closed to new replies.

About this Topic