| filsa.net: Frontier / Scripts / Linking Macros / Images Outside of Frontier |
|
|
UPDATED: Ready for Frontier 5!Images Outside of FrontierSo you say you don't want to keep your images inside Frontier? Well, you've come to the right place.
Well, here it is. Introducing... the {imgFileRef ()} macro! <faint applause> Scenario You've got a graphics guy, who does Photoshop but would break out in hives if he touched Frontier. So you let him do all the graphics for a page, and keep them in a folder. The site is in Frontier, so you want to automatically generate <img> tags without having to suck those images into the ODB all the time (because the graphics keep changing). This macro will help you do that. Important Parameters
#imfFileRef_folder "subfolder:imgFolder:" For example:
{imgFileRef ("kid.gif", imgFolder:"frontier:ii:images:")} should produce a photo of one of my former students (and if it's a dead link, well, you've discovered a huge drawback to this macro--it's your job to make sure the image is there, if you move the site around...)
Cute kid, huh? Other stuff There are a whole bunch of other parameters which you can figure out on your own. They are the basic img tag params.... look at the script for more info... Caching This macro keeps a cache of image height/widths. By default the cache is on. The cache flushes whenever Frontier restarts. You can turn the cache on and off via this directive: #imgFileRef_useCache true This is a huge hack I did it in a couple hours, and I don't expect it to work perfectly. It doesn't support the rollsrc param or lowsrc param. I don't plan on adding features, but you are welcome to experiment with the code and do as you will. This is mostly example code, proof of concept; it mostly works, no known problems. Please don't write and ask me to add features to this particular macro, though. Bug fixes are okay. I hope you benefit from it, and learn how it works, and maybe improve it. It certainly could be improved.
|
||
View the Source: user.html.macros.imgFileRef |
|||
|
© copyright 1997-98 by Philip Suh. Comments are appreciated. This page last updated on 7/19/98; 0:11:56 AM. <http://www.filsa.net/frontier/scripts/LinkingMacros/imgFileRef.html> |
| filsa.net: Frontier / Scripts / Linking Macros / Images Outside of Frontier |