You may well wish to call a bigger image to screen than the thumbnail PortWeb can extract from a Catalogue, the latter only being 112x112 or 256x256 pixels. One easy candidate is to use the Disk Preview files that Portfolio can create for you. However, the snag is that the Previews have filenames like p0000000065.jpg that give no immediate cue as to the associated original image and you must script this association yourself.
The script has the following compatibility requirements:
Remember, the syntax of a Portfolio-created Disk Preview is - p + padding zeroes + RID + .jpg - in which the zeroes + RID = 10 characters. Thus RID 1234 will give preview p00001234.jpg
Here is the script without any explanatory comment:
// script created by Mark Anderson (email@example.com)
var persistPathToPrev = 'subfolder/'
myRID = myRID.toString(10);
var winName = 'RID';
var myZeros = '0000000000';
var lengthRID = myRID.length;
myZeros = myZeros.slice(lengthRID);
myRID = 'p' + myZeros + myRID + '.jpg';
prevPath = persistPathToPrev + myRID;
myRID = '';
popWindow = window.open(prevPath,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0');
Sample usage in a PortWeb template:
<img src="%thumbnail%" border=0>
Don't forget there is a commented version and test files you can download.
Question: How do you link to Disk Previews from thumbnails? [FAQ00200.htm]
Last Update:- 31 May 2006
Site and articles © Mark Anderson 2001-2007 - Visit my home page