Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5527

    Hi there,

    when i open images placed inside a portfolio item with tag with the lightbox, a description is NOT shown. I tried putting it into “title” and “alt”. Alt shows up above the image.

    How can i display the description entered in the wordpress Mediapool below the photo in the lightbox?

    Best regards

    Pat

    #50700

    addition: Doesnt work in your live demo (themeforest) too….

    #50701

    Hey,

    prettyphoto pulls the description from the link title. This feature is not supported at the moment but I’ll ask Kriesi to look into it.

    #50702

    I checked prettyphoto, they pull the title (above image) from the “title”, and the “description” (below image) from the “alt-title”. Title works, alt title not…. would be really nice to have descriptions below photos!!

    #50703

    The docs: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ claim something different:

    “You can also add a title and a description to your picture: To have display a title, add the title into the ALT attribute or your thumbnail image. To have display a description, add the description into the TITLE attribute or your link.”

    The code looks like:

    <a href="images/fullscreen/2.jpg" rel="prettyPhoto" title="This is the description"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="This is the title" /></a>

    I’ll ask Kriesi to look into the link generation function.

    #50704

    yeah, sorry i swapped it.

    alt title works, title (the needed description) doesnt.

    #50705

    I rewrote the Javascript Linkgeneration myself :) Works now!

    Alt title displayed above image if exists and title displayed in description area! Yeah.

    for anyone whos interested, replace this function in avia.js (folder broadscope/js) with this one. Then its just little css styling of prettyphoto to make it looks nice.

    (function($)

    {

    $.fn.avia_activate_lightbox = function(variables)

    {

    var defaults =

    {

    autolinkElements: 'a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=".mov"] , a[href$=".swf"], a[href$=".flv"] , a[href*="vimeo.com"] , a[href*="youtube.com"]'

    };

    var options = $.extend(defaults, variables);

    var imagedefaults =

    {

    autolinkImages: 'img[title!=""]'

    };

    return this.each(function()

    {

    var elements = $(options.autolinkElements, this),

    lastParent = "",

    counter = 0;

    var images = $(imagedefaults.autolinkImages, this),

    imgcounter = 0;

    var alltitlesalt = new Array();

    var alltitles = new Array();

    images.each(function()

    {

    if($(this).attr('alt') != undefined && $(this).attr('alt') !="")

    {

    alltitlesalt.push($(this).attr('alt'));

    }

    else

    {

    alltitlesalt.push("");

    };

    alltitles.push($(this).attr('title'));

    });

    elements.each(function()

    {

    var el = $(this),

    parentPost = el.parents('.post-entry:eq(0)'),

    group = 'auto_group';

    if(parentPost.get(0) != lastParent)

    {

    lastParent = parentPost.get(0);

    counter ++;

    }

    if((el.attr('rel') == undefined || el.attr('rel') == '') && !el.hasClass('noLightbox'))

    {

    el.attr('rel','lightbox');

    el.attr('title',alltitles[imgcounter]);

    el.attr('alt',alltitlesalt[imgcounter]);

    imgcounter ++;

    }

    });

    if($.fn.prettyPhoto)

    elements.prettyPhoto({ "theme": 'premium_photo', 'slideshow': 5000 }); /* facebook /light_rounded / dark_rounded / light_square / dark_square */

    });

    };

    })(jQuery);

    #50706

    ah forgot the jquery.prettyPhoto.js in broadscope seems to be modified. so if you use the code above get the original prettyphoto from the publishers website and replace the broadscope jquery.prettyPhoto.js with the original jquery.prettyPhoto.js

    #50707

    Thanks for providing your code. I’ll report it o Kriesi and add it to the faq section here: http://www.kriesi.at/support/forum/general-questions

    #50708

    Ah, i found a (small) bug.

    The javascript i wrote looks for images with a title and a link and gives them the needed code for the lightbox.

    Through to i only use the featured image without link i didnt realize the bug cause mine didnt get catched.

    So what happens when you got an image at top of your post or as feature with a link includes is, that this pic gets in the lightbox group or – if it doesnt have a link – the title might get catched from the lightbox.

    To fix it: Javascript needs to check if image is feature or not (maybe through the div tags of the content area)

    Meanwhile use featured image only OR give images a link (to post or whatever)

    greetings pat

    #50709

    Hi,

    I’ve just purchased the Avisio theme and have installed the latest version of prettyPhoto.

    You are ok when inserting your own images into a post as you can insert your own alt tags (and linking it with the rel=”lightbox[grouped]). But yes, the featured image doesn’t call the alt description (alt=””).

    Hope this will be updated.

    Cheers,

    Ricky.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Pretty Photo does not show description’ is closed to new replies.