Forums / General / ezlightbox does not work

ezlightbox does not work

Author Message

Anita H

Wednesday 15 July 2009 7:56:32 am

Hi All,

need once again your help (pretty sure won't be last time though): installed ezlightbox with all "corrections" as described in contributions but it doesn't work.

I see e.g. "lightbox thumb" when uploading a new image and it generates the following code:

<a href="/var/ezwebin_site/storage/images/media/images/34-maunganui-04/1093-1-eng-US/34-Maunganui-04.jpg" rel="lightbox" title="34 Maunganui 04">

<img src="/var/ezwebin_site/storage/images/media/images/34-maunganui-04/1093-1-eng-US/34-Maunganui-04_medium.jpg" style="border: 0px none ;" alt="" title="" height="150" width="200"></a>

But there is no effect when clicking on the thumb...the image opens as "usual". I also tried:

{attribute_view_gui attribute=$node.data_map.image image_class='small' lightbox_class=original}

But also with no effect.
Any ideas?
many thanks
Anita

Heath

Wednesday 15 July 2009 8:00:54 am

It has been a while since I tried to use this solution but one thing really annoys me ... It's just not maintained well enough to use daily without headache.

We really need this solution to go into projects.ez.no svn and so development can continue until it is eZ to use this solution right out of the box without having to hack at it every time because it's not been properly maintained.

Any interested parties :?

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Anita H

Wednesday 15 July 2009 8:37:31 am

I tried a template override and created a .tpl with following content:

{def $lighthref = $node.url_alias|ezurl}
{set $lighthref = concat($lighthref, " rel=\"lightbox\"")}
{set $lighthref = concat($lighthref, " title=\"Roll over and click right side of image to move forward.\"")}

<div class="content-view-galleryline">
<div class="class-image">

<div class="attribute-image"{if is_set($#image_style)} style="{$#image_style}"{/if}>
<p>{attribute_view_gui attribute=$node.data_map.image image_class=gallerythumbnail href=$lighthref}</p>
</div>

<div class="attribute-name"{if is_set($#image_style)} style="{$#image_style|explode(';').0}"{/if}>
<p>{$node.name|wash}</p>
</div>

</div>
</div>

Now when clicking on the picture I receive the typical expected background and a progress bar, but the image does never load :-/

Not sure about the approach, but I'd like to use this extension. I also tried to go with lightbox2, installed everything with - at the end - the same result: the picture never loads.

Any ideas?
Thanks for your help
Anita

Max Keil

Wednesday 15 July 2009 9:58:46 am

Hi Anita,

{def $lighthref = $node.url_alias|ezurl}

...

{attribute_view_gui attribute=$node.data_map.image image_class=gallerythumbnail href=$lighthref}

href - attribute should be the url to your image,
ezurl - should be changed with ezroot

{def $lighthref = $node.data_map.image.content.LIGHTBOXIMGCLASS.url|ezroot}

I think the image is not linked correctly. ezroot is needed because the files are stored in var/...

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Anita H

Wednesday 15 July 2009 10:33:14 am

Hi Max,

thanks a lot - that's doing the trick :-)

Do you know whether rel="lightbox[clixxGuide]" is also working?
or does it work differently in ezlightbox?

Many thanks
Anita

Max Keil

Wednesday 15 July 2009 5:49:10 pm

Hi Anita,

I didn't found out which version of the lightbox.js is used here. Maybe it is an older one and do not support this feature. Try it out.

In my opinion it's not necessary to install this extension for lightbox features. There are already thousands of clones of this with more features and lightweight size.

Just take the Slimbox for Mootools or jQuery ( http://www.digitalia.be/software/slimbox ), the FancyBox ( http://fancy.klade.lv/ ) or the MediaBoxAdvanced ( http://iaian7.com/webcode/mediaboxAdvanced ). The both last of them also supports external content, flash, youtube and so on. Create an override for the /content/datatype/view/ezimage.tpl and do some changes to support attribute "rel" as parameter for it. Done.
Now you can decide which of the images should be shown in a lightbox. Something like this.

{attribute_view_gui attribute=$node.data_map.image image_class=medium rel=lightbox[gal] href=$imagepath}

Alternatively you can create the href url within the ezimage.tpl if you rel is starting with lightbox and set only the image_class for it!

{attribute_view_gui attribute=$node.data_map.image image_class=medium rel=lightbox[gal] lightbox_class=original}

Thats's it. Now you can use your preferred JS framework and the compatible ligthbox clone.

If you have some troubles to set up your ezimage.tpl just contact me - I will give you a copy of mine.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Anita H

Thursday 16 July 2009 1:06:51 am

Hi Max,

many thanks. I installed lightbox2 which worked now too, but now decided to go with mediabox advanced. The installation was really easy going - as described by you and on the webpage of mediabox advanced.

If you - by any chance - have got good advice for bringing up "print view" templates and "pdf generation" with logo, google map, columns, graphics and text I'd be more than happy :-)

cheers
Anita

Max Keil

Thursday 16 July 2009 2:39:36 pm

Hi,

do you mean the /layout/set/print view with "print view"? Simply override the templates matching the layout print.

I've heard of Paradox PDF ( http://projects.ez.no/paradoxpdf ) should be a great extension to create pdf views.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Wednesday 22 July 2009 7:19:48 am

Anita,

I am new to ezPublsih,

Can you please tell in detail how to create LightBox.....

Anita H

Thursday 23 July 2009 9:08:32 am

Hi Srikanth,

I switched from lightbox2 to mediabox advanced (see Max' reply) further below in this threat.
Just follow the installation hints on mediabox website and Max description in this threat.

It works - no issues.
Hope this helps
Anita

Anita H

Thursday 23 July 2009 9:13:32 am

Hi Max,
thanks for your help. Yes, I meant the print view (/layout/set/print view).
I created a override template for print view and separated CSS style sheet.
Everythings works beside little details between the layount of the print-template is producing a slightly different view than the actual print preview. However, I need to "play" more with this topic and then will switcht to the PDF generation.

The main point is, that I would like to reuse the very same templates whenever possible for web-display and print-view-display because I've quit a bit of code in it and I do not want
to duplicate code...

Sometimes I think it would be nice to meet real heavy ezDevelopers just to learn best practice ;-)

cheers
Anita

Max Keil

Thursday 23 July 2009 12:26:13 pm

Hi Anita,

you can use your web-view templates for the print-view.

Simply override your pagelayout.tpl for the layout print:

[full_nodes_index]
Source=pagelayout.tpl
MatchFile=print/pagelayout.tpl
Subdir=templates
Match[node]=2
Match[layout]=print

In this pagelayout you can define other CSS-Styles which are also used by your templates but for the print view.

OR

you can define a link-tag for this issue, without to override the pagelayout

<link rel="stylesheet" type="text/css" href="/extension/all2e/design/all2e_design/stylesheets/print.css" media="print" />

This css will be automaticly "redesign" your page if you click on the print button. (in the normal web-view)
An example is used on our webpage:
http://www.all2e.com/Ressourcen/Artikel-und-Fallstudien/Varnish-installation-and-setup-on-ez-publish-based-systems

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Friday 24 July 2009 8:09:39 am

I have downloaded the the lightbox "jquery-lightbox-0.4.zip".unzipped and copyed "jquery.js" and "lightbox.js to JavaScript folder mypath is [design\plain_site\javascripts\]" I copyed "lightbox.css" to CSS folder[design\plain_site\stylesheets] and images like loading.gif to images folder [design\plain_site\images]

Following is the code which have written

<link rel="stylesheet" media="screen" type="text/css" href={"stylesheets/lightbox.css"|ezdesign} />

<script SRC={"javascripts/jquery.js"|ezdesign} type="text/javascript" language="JavaScript" charset="UTF-8"></script>
<script SRC={"javascripts/lightbox.js"|ezdesign} type="text/javascript" language="JavaScript" charset="UTF-8"></script>

<a href="var/plain_site/storage/images/media/images/travel-card-thumbnail-22\531-1-eng-US/Travel-Card-Thumbnail-2.jpg" rel="lightbox" title="34 Maunganui 04">
<img src={"Travel-Card-Thumbnail-2.jpg" |ezimage} border="0"/>
</a>

After this when i click on thunbnail image Travel-Card-Thumbnail-2.jpg i get the popup with lightboz but non of the images load including "loading.gif". I am also getting javascript error.[Invalid argument]

I get this Javascript erro as sson i load the photo gallery page

Can any one help me how to proceed further...where i am going wrong

Max Keil

Monday 27 July 2009 12:32:29 pm

Hi,
your lightbox images are specified in lightbox.js?

you should change the path to the images like this:

...
imageLoading : 'design/plain_site/images/loading.gif'
...

always start from the ez-root folder!

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Tuesday 28 July 2009 1:57:53 am

I placed the following code in Lightbox.js initially

fileLoadingImage : 'design/plain_site/images/loading.gif'
, fileBottomNavCloseImage : 'design/plain_site/images/closelabel.gif'

It was still giving an error and following was the "loading.gif" path

"http://localhost/example2/index.php/plain_site/content/view/full/design/plain_site/images/loading.gif"

Later I changed the code in Lightbox.js to

fileLoadingImage : '../../../../design/plain_site/images/loading.gif'
fileBottomNavCloseImage : '../../../../design/plain_site/images/closelabel.gif'

Still i am getting an Java script error and following was the "loading.gif" path displayed when selected the property

"http://localhost/example2/index.php/design/plain_site/images/loading.gif"

Please do let me know where i am going wrong

Max Keil

Tuesday 28 July 2009 3:04:54 pm

Hi,

try to change
fileLoadingImage : '/design/plain_site/images/loading.gif',
fileBottomNavCloseImage : /'design/plain_site/images/closelabel.gif'

look at the leading slash in front of the path. You should not use "../../" in your js-files - because the relative path will always be changed with your tree.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Wednesday 29 July 2009 5:52:52 am

no, the image didn't load again....the path is "http://localhost/design/plain_site/images/loading.gif"

Max Keil

Wednesday 29 July 2009 3:46:50 pm

Can you directly access the images with your browser if you paste the path into it?

Maybe some of your rewrite rules not working correctly - can you check it out?
You should have something like this in your .htaccess or vhost conf with leading slash.

Rewriterule ^design/[^/]+/(stylesheets|images|javascript|flash)/.* - [L]

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Thursday 30 July 2009 5:57:17 am

Thanks it is working now....

Max Keil

Thursday 30 July 2009 10:20:28 am

Great!!!

Here are some other htaccess rules that we use for eZ Publish:

RewriteRule ^(.*)favicon\.ico - [L]
RewriteRule ^robots\.txt - [L]
RewriteRule ^sitemap\.xml - [L]
RewriteRule ^var/cache/debug.html.* - [L]
RewriteRule ^var/[^/]+/cache/public/.* - [L]
Rewriterule ^var/storage/.* - [L]
Rewriterule ^var/export/* - [L]
Rewriterule ^var/[^/]+/storage/.* - [L]
RewriteRule ^/var/[^/]+/cache/(texttoimage|public)/.* - [L]
Rewriterule ^design/[^/]+/(stylesheets|images|javascript|flash)/.* - [L]
RewriteRule !\.(gif|jpe?g|png|css|js|html?)|var(.+)storage.pdf(.+)\.pdf$ index.php
Rewriterule ^share/icons/.* - [L]
Rewriterule ^extension/[^/]+/design/[^/]+/(flashs|stylesheets|images|javascripts|javascript|flash)/.* - [L]
Rewriterule ^packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule .* index.php [L]

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh