Since it was asked about recently I have quickly knocked together this to show one way you can intergrate Lightbox into Actinic. There are a few ways to do it but I found this the easiest, feel free to add tips etc if you have any!
1. Download Lightbox and extract the contents
2. Copy all the files (excluding index.html) into your site directory, making sure you do not copy the folder structure, just the physical files. By the end you should have copied a number of images, a css file and 4 js files directly into your site folder
3. Open lightbox.js in a text editor. You will find image references in there that currently point to "images/close.gif' etc. Go through the file and remove every instance of "images/" you find, leaving just the reference to the actual image file in place. Then open lightbox.css and remove all references to '../images/' within the file.
4. Open Actinic and navigate yourself to your head section then add this code
below
5. Then add
after
5. Add all the lightbox files to Design | Additional Files, they should be as follows (unchecked):-
lightbox.css
blank.gif
close.gif
closelabel.gif
loading.gif
next.gif
nextlabel.gif
prev.gif
prevlabel.gif
effects.js
lightbox.js
prototype.js
scriptaculous.js
That's the code ready to be used, now all you need to do is intergrate it into the Actinic layouts. For this, we set up a block that looks for the text 'Lightbox' within the extended information text box, if it is found it uses the lightbox code if not it uses the standard pop up box. This allows you to control whether a pop up box or lightbox is used depending on what text is entered into this box.
Integrating into the Product layouts:-
1. Go to Design | Library | Layouts
2. Open the layout called Standard Product Image
3. Replace everything in this layout with the code below
The code will display the product name within Lightbox, you can change this to something else if you want though.
That should be you. To implement create your extended info pages as normal, making sure you include the image you want to display, and if you want to use Lightbox, simply type 'Lightbox' into the Extended Information text box. If you intend to use Lightbox exclusively and have no plans for pop up boxes you can simplify it by just overwriting the standard pop up code
with
This will mean that you won't need to type 'Lightbox' into the extended info box to make it work, but it does mean pop ups wont work anymore so be careful!
There are numerous other ways to do this, this is just how I chose to so please have a play around and see if you can come up with something better. If you want to view this offline you will need to copy all images, css and js files to the PreviewHTML directory
Also, take a snapshot before you try anything and note that i typed this up quite quickly, if you find any mistakes give me a shout and I will update the code!
Want to display multiple product images? See Norman's suggestion below (post 6)
1. Download Lightbox and extract the contents
2. Copy all the files (excluding index.html) into your site directory, making sure you do not copy the folder structure, just the physical files. By the end you should have copied a number of images, a css file and 4 js files directly into your site folder
3. Open lightbox.js in a text editor. You will find image references in there that currently point to "images/close.gif' etc. Go through the file and remove every instance of "images/" you find, leaving just the reference to the actual image file in place. Then open lightbox.css and remove all references to '../images/' within the file.
4. Open Actinic and navigate yourself to your head section then add this code
Code:
<script type="text/javascript" src="prototype.js"></script> <script type="text/javascript" src="scriptaculous.js?load=effects"></script> <script type="text/javascript" src="lightbox.js"></script>
Code:
<script language="JavaScript" src="actiniccore.js" type="text/javascript"></script> <script language="JavaScript" src="actinicextras.js" type="text/javascript"></script>
Code:
<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
Code:
<link href="actinic.css" rel="stylesheet" type="text/css" />
lightbox.css
blank.gif
close.gif
closelabel.gif
loading.gif
next.gif
nextlabel.gif
prev.gif
prevlabel.gif
effects.js
lightbox.js
prototype.js
scriptaculous.js
That's the code ready to be used, now all you need to do is intergrate it into the Actinic layouts. For this, we set up a block that looks for the text 'Lightbox' within the extended information text box, if it is found it uses the lightbox code if not it uses the standard pop up box. This allows you to control whether a pop up box or lightbox is used depending on what text is entered into this box.
Integrating into the Product layouts:-
1. Go to Design | Library | Layouts
2. Open the layout called Standard Product Image
3. Replace everything in this layout with the code below
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpDisplayedByImage%22%20%2f%3e"> <actinic:block if="%3cactinic%3avariable%20name%3d%22ExtendedInformationType%22%20%2f%3e%20%3d%3d%20%22Opens%20in%20a%20Pop%2dUp%20Window%22%20AND%20%3cactinic%3avariable%20name%3d%22ExtendedInfoText%22%20%2f%3e%20%21%3d%20%27Lightbox%27" > <a href="javascript:ShowPopUp('<actinic:variable name=ExtendedInfoPageEncoded />',<actinic:variable name="ExtInfoWindowWidth" />,<actinic:variable name="ExtInfoWindowHeight" />);"> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22ExtendedInfoText%22%20%2f%3e%20%3d%3d%20%27Lightbox%27"> <a title="<actinic:variable name="ProductName" />" rel="lightbox" href="<actinic:variable name="ExtendedInfoImage" />"> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22ExtendedInformationType%22%20%2f%3e%20%3d%3d%20%22Opens%20in%20the%20Same%20Window%22" > <a href="<actinic:variable name="ExtendedInfoPageName" />"> </actinic:block> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e"> <img src="<actinic:variable name="ProductImageFileName" />" border="0" width="<actinic:variable name="ProductImageWidth" />" height="<actinic:variable name="ProductImageHeight" />" alt="<actinic:variable name="ProductName" encoding="strip"/>" /> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e%20%3d%3d%20False"> <img src="<actinic:variable name="DefaultProductImage" />" border="0" alt="<actinic:variable name="ProductName" encoding="strip"/>" /> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpDisplayedByImage%22%20%2f%3e"> </a> </actinic:block>
That should be you. To implement create your extended info pages as normal, making sure you include the image you want to display, and if you want to use Lightbox, simply type 'Lightbox' into the Extended Information text box. If you intend to use Lightbox exclusively and have no plans for pop up boxes you can simplify it by just overwriting the standard pop up code
Code:
<a href="javascript:ShowPopUp('<actinic:variable name=ExtendedInfoPageEncoded />',<actinic:variable name="ExtInfoWindowWidth" />,<actinic:variable name="ExtInfoWindowHeight" />);">
Code:
<a title="<actinic:variable name="ProductName" />" rel="lightbox" href="<actinic:variable name="ExtendedInfoImage" />">
There are numerous other ways to do this, this is just how I chose to so please have a play around and see if you can come up with something better. If you want to view this offline you will need to copy all images, css and js files to the PreviewHTML directory
Also, take a snapshot before you try anything and note that i typed this up quite quickly, if you find any mistakes give me a shout and I will update the code!
Want to display multiple product images? See Norman's suggestion below (post 6)
Comment