Lightbox on all Images

It looks like the modal script (whether it be Lightbox, FancyBox or something else) is only loaded on the product pages. It's loaded right before the but I cannot find any if statements to actually complete this action in the scripts.tpl, the index.tpl or anything else. Where is the file being loaded?



I need to include it on all pages so I can have images on pages and elsewhere open in the lightbox just like the products do.



Anyone able to point me in the right direction?



Thanks in advance!

{include file=“common_templates/previewer.tpl” rel=“preview[product_images]”}

add this line in scripts.tpl, then previewer will work on all pages

[quote name='N1XUS' timestamp='1313768766' post='119883']

{include file=“common_templates/previewer.tpl” rel=“preview[product_images]”}

add this line in scripts.tpl, then previewer will work on all pages

[/quote]



Thank you! Do I need to add any rel tags or anything to my images or will CS-Cart do that?

[font=“Verdana”]This is a great idea! We have a “Category Gallery” with all sorts of includes to external files to make this work.



This is just so simple! :D



Thank you @ N1XUS!

:)





P.S.

Did you mean scripts.tpl in: …/skins/_____/customer/common_templates/?

[/font]

[quote name=‘UniDevelopers’ timestamp=‘1315363944’ post=‘121113’]

[font=“Verdana”]This is a great idea! We have a “Category Gallery” with all sorts of includes to external files to make this work.



This is just so simple! :D



Thank you @ N1XUS!

:)





P.S.

Did you mean scripts.tpl in: …/skins/_____/customer/common_templates/?

[/font]

[/quote]

yes, and dont forget to add rel=“preview[product_images]” and class=“cm-previewer” to all links for images

So add following to the end of the header code:

PATH: …/skins/______/customer/common_templates/scripts.tpl

CODE: ```php
{include file=“common_templates/previewer.tpl” rel=“preview[product_images]”}

```

For all links on a page (linked to an image) add the following code to the A link tag:
```php ... rel="preview[product_images]" class="cm-previewer" ... ```

[b]EXAMPLE:[/b]
```php

```

Okay... I [i][u]think[/u][/i] i've got it...
:)

I just tried to implement this, however, it appears nothing is added inside the of the document. I am trying to create the Lightbox effect on some images on a Content Page.



The source code shows the tag still has the rel and class tags assigned, but I am assuming the code:

{include file="common_templates/previewer.tpl" rel="preview[product_images]"}


Which I have added to /skins/mytheme/customer/common_templates/scripts.tpl is not having any effect.



Any what the stumbling block is here, did anyone else get it working?

I am very interested in the decision of the given problem too. I added a line in script.tpl, but doesn't work (((

HI I have this working…



I added the line directly into the head of the site through index.tpl



like so


```php


{strip}

{if $page_title}
{$page_title|escape:"html"}
{else}
{foreach from=$breadcrumbs item=i name="bkt"}
{if !$smarty.foreach.bkt.first}{$i.title|unescape|strip_tags|escape:"html"}{if !$smarty.foreach.bkt.last} :: {/if}{/if}
{/foreach}
{if !$skip_page_title}{if $breadcrumbs|count > 1} - {/if}{$location_data.page_title|escape:"html"}{/if}
{/if}

{/strip}
{include file="meta.tpl"}

{include file="common_templates/styles.tpl" include_dropdown=true}
{include file="common_templates/scripts.tpl"}
{include file="common_templates/previewer.tpl" rel="lightbox"}

```

as you see i have also changed the rel to "lightbox" meaning that i/my users can select the rel through the editor rather than having to type it in every time.

now i just need to figure out where to change the class...

Can someone give me some example code to use this to make a lightbox open up to another website, for example google.com?



For example, if you visit a content page, and there is a link that says “click here”. When clicked, it opens a lightbox modal window to google.com



Thanks.

I too can get this working, sort of. I inserted the

{include file="common_templates/previewer.tpl" rel="preview[product_images]"}

into the index.tpl head section, and added the

rel="preview[product_images]" class="cm-previewer"

to each image.



However, when there are multiple images on the page, it gives the ability to scroll through all of the images on the page. For example, when I click on image A, image A will display properly (I have fancybox), but I can then scroll to image B, C, D, and so on. If I click on image B, image B will display properly, but I can then scroll back to image A or on to image C, D, and so on.



How can I just have just the single image display without the option to scroll and view all of the other images on the page?



Thanks for any input…

One last bump if anyone has any input to get this working…

[quote name='StellarBytes' timestamp='1318948141' post='123946']

I just tried to implement this, however, it appears nothing is added inside the of the document. I am trying to create the Lightbox effect on some images on a Content Page.



The source code shows the tag still has the rel and class tags assigned, but I am assuming the code:

{include file="common_templates/previewer.tpl" rel="preview[product_images]"}


Which I have added to /skins/mytheme/customer/common_templates/scripts.tpl is not having any effect.



Any what the stumbling block is here, did anyone else get it working?

[/quote]



You need to clear the cache! add ?cc after your site URL… as in
yourdomain.com