Foros de discusión

Lightbox resp. Fancybox Integration in Blog

thumbnail
Yves LeGrand, modificado hace 12 años.

Lightbox resp. Fancybox Integration in Blog

Regular Member Mensajes: 156 Fecha de incorporación: 18/11/09 Mensajes recientes
Hi there,

we want to use the fancybox for any picture which is shown in a blog entry.
Unfortunately the fancybox seems to have a problem with the urls from the image gallery.

Can someone help us with this?

Thanks a lot.

Regards,
Yves
Oliver Bayer, modificado hace 12 años.

RE: Lightbox resp. Fancybox Integration in Blog

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
Hi Yves,

I'm using the jquery colorbox plugin to show images in a popup. There I had to set the option "photo: true" in the js call to display the images correctly. After a quick look at the fancybox api I think you should add the option type: 'image' to the js call.

HTH Oli
thumbnail
Yves LeGrand, modificado hace 12 años.

RE: Lightbox resp. Fancybox Integration in Blog

Regular Member Mensajes: 156 Fecha de incorporación: 18/11/09 Mensajes recientes
Hi again.

Is it possible to hook the fancybox libraries etc. into the blog-portlet?
Or is it necessary to include these libraries into the theme?
How would you do that?

Thank a lot.

Best wishes,
Yves
Oliver Bayer, modificado hace 12 años.

RE: Lightbox resp. Fancybox Integration in Blog

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
Hi Yves,

first of all: does my sugguested solution to add a configuration option solves the issue so that images are shown in the popup?

There are several possible solutions to add a javascript to a portlet depending on your requirements:

1. add the js to the theme (useful if the js is used by more portlets)
2. add the js in the portal-ext.properties by modifying "javascript.barebone.files" or "javascript.everything.files" (useful if the js is used by more portlets)
3. put the js into "html \ js \ <your folder>" and add a link to the portlet to include the script (useful if you have only one or two portlets using this script)

Greets Oli
thumbnail
Yves LeGrand, modificado hace 12 años.

RE: Lightbox resp. Fancybox Integration in Blog

Regular Member Mensajes: 156 Fecha de incorporación: 18/11/09 Mensajes recientes
Hi Oliver.

The jquery.plugins.js which is a part of our fancybox "distribution" contained a regular expression which excluded filse without image file extensions like jpg, bmp, etc.
So what we have done is just the adjustment of this regular expression. And it works. :-).

I have included the js-files into the hook like you have described in option 3.

Thanks a lot,
Yves

Ps.: Maybe u know something about how to include javascript, jquery, etc. without having any trouble with conflicts etc. ?