Recent Topics

1 Jan 13, 2015 12:49    

I've tried looking for answers to this, but not succeeded at this point.

I'm using colorbox for my images, but I can't see how to use it on images that are not linked to the post (i.e. the image may be in an external photo album somewhere. Is there a way, or is colorbox just for images linked in the blog?

Thanks

2 Jan 15, 2015 07:12

Hi @scribbly,

You can use the built-in colorbox to display your own images. If you insert your images using the "Simple method" described here: http://b2evolution.net/man/how-to-include-external-photos, you just need to add three parameters to the inserted snippet. Go to the <a> tag outside the image and add the following:

1. class="cboxElement" -- It's required by colorbox to know that the element will be displayed in a modal window
2. rel="lightbox[pPostID]" -- it's related with the b2evolution customization. Just replace "PostID" by the id of the post in which you're adding the image.
3. id="uniqueID" -- an unique id for the element

This is a sample of the resulting code:


<div class="image_block">
  <a href="/media/blogs/a/b2evolution8.png?mtime=1421301402" class="cboxElement" rel="lightbox[p32]" id="imglink_99">
    <img src="/media/blogs/a/b2evolution8.png?mtime=1421301402" alt="" width="221" height="65" />
  </a>
</div>

Just remember that the voting options won't be available for images displayed this way.

Regards!

4 Jan 15, 2015 19:57

@scribbly I just left you a comment in the other post. Let's see if I'm correct and your problem is solved.


Form is loading...