Elgg 1.9rc2: Picture not opened within a lightbox

Hey guys,
I'm trying to open a picture (from a thumb) in a lightbox but I only get garbish (cryptic signs, I think the browser is trying to open the pic as text and not as an image). I already copied the code from the showcase-plugin for that, where it seems to work, but it doesn' work on my server. A direct call of the url works, but a call within a lightbox not. Here is the (simplified) code. Please, can you help me?

  • Try to get file using file_get_contents

  • Thanks for this hint, but the output is the same :(

    I'm experiencing this problem since Elgg 1.9, with 1.8 the output was fine. The content-type within the header should work, in the view.php the img within the <a>-tag is displayed correctly.

    I now *could* create an extra-view (which I, for testing, already did) to call the content for the lightbox within an <img>-tag, but in this case the size for the lightbox is very small the every first time I click on an image to open it -.-

    Which elgg-version is this community-site? Already 1.9 (it seems like that because of the theme)? Here the showcase-plugin (where I have the above code-snippet from) works fine as well...

  • I was grabbing a bit deeper and found another possible class (within the lightbox.js) to declare a lightbox:

    elgg-lightbox-photo

    This sets the content-type for the lightbox to photo:true, which means:

    If true, this setting forces Colorbox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg')

    This solves my problem! It would be great if this class could mentioned in the docs somewhere...

  • Hey, Viktor, glad you found a solution -- agreed that'd be nice to have in the docs. Can you report an issue on github for us to add that or better yet submit a PR to add it? Thanks!

  • That's one of the reasons I've started creating image urls with an 'image.jpg' type ending

    Better compatibility with dumb libraries