Archive of UserLand's first discussion group, started October 5, 1998.
buttonRef macro
Author: Brian Kelly Posted: 3/12/1999; 11:42:29 AM Topic: buttonRef macro Msg #: 4034 Prev/Next: 4033 / 4035
I'm basically posting this to see if anybody else likes it, has done their own version, or has suggestions/better answersI added a tiny feature to the imageRef macro to handle the state of a button (on or off) and renamed it buttonRef. Here is the additional script (placed right under the DW/PBS comments):
if defined (pagetable^.["#sectionid"]) {
local (sectionid = pagetable^.["#sectionid"]);
if (imagespec == sectionid) {
imagespec = "b_" + imagespec + "_on";
glossRef = ""}
else {
imagespec = "b_" + imagespec + "_off"}}
So if the page you are rendering has a #sectionid that is equal to the imagespec then it changes it to b_imagespec_on. Otherwise it's b_imagespec_off.
So within your template (or where ever) you make calls to the buttonRef and if the image you are calling has the same name as the sectionid it uses the _on version, otherwise it uses the _off version. It also "shuts off" the glossRef (actually that's a bad idea).
-brian
PS I just switched jobs (yea!) from Tech Support to Graphic/Web Design (double yea!) and am now I on a Mac (uhm, yea...). I remember when Dave first got on Windows people gave him a bunch of tips/pointers/links. I'm looking for the same thing.
PPS Macs are cool too.
There are responses to this message:
- Re: Mac tips, Ian Beatty, 3/12/1999; 12:52:46 PM
This page was archived on 6/13/2001; 4:48:43 PM.
© Copyright 1998-2001 UserLand Software, Inc.