filsa.net: Frontier / Scripts / Linking Macros / Images with Glossary
This is part of Phil's Script Archive

UPDATED: Ready for Frontier 5!

Images with Glossary

Combine the function of imageRef with the power of your glossary. Easy linked graphics in your pages.


This fat web page contains the glossImageRef script object.

Use the 'Get Page Data' command from the Scripts menu to copy glossImageRef into your object database.

Also available: info about fat pages and the Terms under which you can use this script.

Note for Frontier 5: This macro's functionality is duplicated in the new updated imageRef for Frontier 5. Check it out:

When you learn HTML, one of the first things you learn is how to create links. Using the <a href> tag, you can connect to other places and documents easily. And you can put whatever text or even graphics you please inside the <a> and the </a>. It's cool!

So when you come to Frontier, of course you expect that, once again, you can put anything you want to between those tags, especially images. But when you work with the glossary, you get locked into whatever the contents of the glossary are when it's created. So you can't be so creative with the links.

Being Creative Again

Of course, this is Frontier, so it's not so hard to get it to change its behaviour. This script allows you to use images as the linked item when you use the glossary. For example:

Rather than say filsa.net, I can put up a graphic instead. It's more fun, and more useful in certain situations. Run your cursor over the filsa.net icon and you should see that it is a link. Pressing it will take you to the filsa.net home page.

Using the macro

Okay, suck in the data from this Fat Page and save. The script is called glossImageRef and goes in user.html.macros.glossImageRef. It takes the following parameters:

glossImageRef (imagespec, glossspec, imgAlign="", imgHSpace="", imgAltString="", targetName="", mouseOver="")

imagespec: String containing name of image file in one of your image tables, or an address of a binary object containing the picture. Same as imageRef imagespec parameter, can do whatever imageRef can do.

glossspec: A string that will be processed by html.refglossary. Should match a current glossary entry.

The next three parameters are optional, and go directly to imageRef. If imgAltString is null, then the glossary text that is being substituted goes into the <img> alt string.

targetName: This is a string, denoting the name of a frame or a special target string ('_top', '_blank', etc.) Optional. If this parameter is entered, the results will be processed through the glossTarget() script (which in turn requires the glossPatcher() script).

mouseOver: an optional string that will be displayed in the status line of JavaScript capable browsers when the cursor is over this link. This string is passed to the required mouseOver() script.

Notes

Jul 14, 1997:

Kenneth Hagler kindly pointed out a small bug in the alt text returned for regular glossary entries. You don't have to worry about it, it's gone now.

Jul 31, 1997:

This script was updated to add support for targeting.

Aug 27, 1997:

Added support for the mouseOver event.

This script requires some other scripts for everything to work properly: glossTarget(), mouseOver(), and glossPatcher().

View the Source: user.html.macros.glossImageRef


© copyright 1997-98 by Philip Suh. Comments are appreciated.
This page last updated on 7/18/98; 9:16:04 AM.
<http://www.filsa.net/frontier/scripts/LinkingMacros/glossImageRef.html>
filsa.net: Frontier / Scripts / Linking Macros / Images with Glossary