Webmaster Tips
Cool and Easy NetCloak Tags
I just prepared a rather long piece on how to use NetCloak to make a
"Smart Error Page" for your site, which will fix common mistakes,
email you notification about problems with your site, and keep your
bathroom sparkling clean.
Ok, it doesn't really do anything for your bathroom, I'm sorry to
say.
Before we dive into that one, I want to let you know about some
simple NetCloak additions you can make to your pages to display
information dynamically. This one is specifically for those of you
who are hosted on our servers (or another server that uses NetCloak).
The first of these is something I use on most of my site: a tag that
shows the last update. To display the last time a particular page
was modified, simply put
Last Updated: <INSERT_MODIFIED>
on your page. <INSERT_MODIFIED> looks at the last time the file was
saved, and reports that on your web page.
Another that I like to use shows the web address of the page, so that
if someone prints the page, they'll know how to get back to it. Put
the following on your page:
<INSERT_HOST><INSERT_THISURL>
The first part, Insert_Host, puts your domain name in. The second
part plugs in the rest of the path to the particular page.
Actually, I often string these two together:
<INSERT_HOST><INSERT_THISURL> Last Updated: <INSERT_MODIFIED>
which comes out something like:
http://www.greenbuilder.com/general/BuildingSources.html Last
Updated on Tuesday, May 1, 2001
You can also insert the current time or date:
Today is <INSERT_DATE>
The time in Austin is <INSERT_TIME>.
And you can "offset" the time to show it in a different time zone:
The time in California is <INSERT_TIME -2>.
The Time in New York is <INSERT_TIME +1>.
There are several additional parameters which allow inserting a
single part of the date. These are:
DayNum - Day of the month (1 - 31)
DayName - The day name (Sunday, Monday)
WeekNum - The week number (1 - 53)
MonthNum - The month number (1 - 12)
MonthName - The month name (January, February)
Year
For example, you could write:
Today is <INSERT_DATE DAYNAME>, the <INSERT_DATE DAYNUM> of
<INSERT_DATE MonthName>, <INSERT_DATE YEAR>.
NetCloak also will generate a random number for you. By default
(without a range specified), the value will be between 1 and 100.
Here are a few examples:
Random number between 1 and 100: <INSERT_RANDOM>
Random number between 1 and 5: <INSERT_RANDOM 5>
Random number between 1 and 500: <INSERT_RANDOM 500>
Why would you want to use this? Well, one example I've used it on
was a contest page for one of our clients. They wanted 1 winner of a
free book in every 100 visitors, a discount for another 24 visitors,
and the rest were invited back for another try tomorrow. (I also
used some other NetCloak tricks to make sure that they couldn't just
keep trying until they won, and still other NetCloak tools to display
different information to each of the three categories - all at the
same web address! We'll go into that one in more detail later...) I
also use it to randomly deliver banner advertising - if I have 5
advertisers, I can name their banners "ad1.jpg" "ad2.jpg",...etc, and
then deliver them using something like the following:
<IMG SRC =
"http://www.greenbuilder.com/images/ad<INSERT_RANDOM 5>.jpg">
Each time the page is loaded, one of the banners is chosen at random.
You can see this in action on the Sustainable Building Sourcebook
(http://www.greenbuilder.com/sourcebook/)
Another command you can use will insert the URL of the last page
visited into your document at the specified point. The URL will be
exactly as reported by the browser, including server name and path
and search arguments.
Here is an example:
You just came from: <INSERT_REFERRER>.
If you want, you can:
<A HREF="<INSERT_REFERRER>">Go Back!</A>
Note that this command will not work if the browser does not report
the last page the user visited. In general, the referrer will be
reported when the user clicks on a hypertext link to access the page.
However, if the user manually enters the URL, the browser may not
send the referrer, since the page the user was on when they entered
the URL doesn't actually reference the page being served.
Since REFERRER is commonly misspelled REFERER (including in early
versions of the Internet specification for HTTP - what do you expect from a bunch of nerds?), NetCloak also
supports that spelling for all REFERRER commands.
I hope these few simple tags will get your gears going about what
might be possible on your site. If you want to really dive in, look
up the NetCloak documentation, and/or join their tech support list.
There's an amazing amount of cool stuff you can do.
And if you don't want to do it yourself, don't forget that we're
always available for hire ;-)
Home
|