Can you use the automatically generated preview images when presenting your Portfolio data through PortWeb? Yes. 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.
So, how do you find the right preview to display? The solution is to use JavaScript and the Record ID macro (%RID%). If you are uncertain about Preview naming syntax and Record ID read here first before going on with this topic.
In principle, using JavaScript, you take the RID value from PortWeb and pad it out to the required syntax then concatenate it to a fixed path to the folder holding the previews.
I have created a template and test files which may be downloaded. They enable you to run and test a script which returns the path to a preview when supplied with the record's RID, e.g. www.mydomain.com/previews/ + p0000012345.jpg. Using this information you can link to a preview image from a thumbnail.
Having large number of previews in one folder can degrade performance when viewing the folders in Finder/Explorer, especially on lower-resourced computers. You may find it convenient to split the previews into batches of several hundred per folder. In this case you will need to add an extra variable step to the procedure above. In addition to fixed path and RID you'll need to parse the RID value and select the appropriate preview folder to put between the fixed path and RID, e.g. www.mydomain.com/previews/ + folder5/ p0000012345.jpg.
Question: How do you display Disk Previews instead of thumbnails? [FAQ00051.htm]
Last Update:- 31 May 2006
Site and articles © Mark Anderson 2001-2007 - Visit my home page