NetCloak Demo

  By now, you should be starting to get a feel for the kinds of things that NetCloak can do on your site. This page will introduce some more NetCloak commands, starting with a couple that that can be incredibly useful. At the end you will be able to take a look at a page that shows nearly all of NetCloak's commands.

The REDIRECT Command

The REDIRECT command, as you would expect, allows you to redirect the client from a page on your site to another URL. This happens without the user clicking a link- the new URL just appears in their browser like magic. REDIRECT alone can solve a myriad of site maintenance problems where published URLs must remain even though you have restructured the site.

Using the REDIRECT command is fairly simple. Just include the URL you wish to redirect the user to. The URL need not be on your own site- it can be any URL at all. For example:

    <REDIRECT "http://www.maxum.com/NetCloak/UsersGuide/">

REDIRECT has the same effect as a META REFRESH tag, but with two important differences. Like all NetCloak commands, it is processed on the server, and so it will work with all web browsers. And, as you can see above, the command is much simpler to remember- just REDIRECT and the URL in quotes.

The REDIRECT command can be even more powerful when combined with conditional SHOW and HIDE commands. Working together, these can redirect clients to a different page depending on their browser type, the URL they requested or any other SHOW/HIDE comparison. There are several examples of this technique on examples.maxum.com which you will see later.

The MACRO Command

Macros allow you to define a common bit of text or snippet of HTML in one place, then conveniently use it in many pages by just referring to it by name. This is useful for creating common headers, footers and navigation links on your site without resorting to frames. Adding a macro to a cloaked page is simple:

    <MACRO Header>

The contents of the macro, of course, will be inserted in the page just as if they were part of the file. By defining common text or HTML in a macro, you need only update it in one place and every instance will be automatically updated. This allows you page design flexibility that would otherwise be a maintenance nightmare.

Macros can contain text, HTML and even other NetCloak commands. Combining HTML and NetCloak commands to make dynamic macros can be tremendously powerful.

Macros can be defined one of two ways: either as part of the special NetCloak.macros file (in the NetCloak Files folder on the server), or as separate text files on the server. Defining macros in the NetCloak.macros file is helpful because it keeps all of your macros in the same place. It has the added advantage of caching all of the macros in RAM.

Here is a sample macro as it would be defined in the NetCloak.macros file:

    <BEGIN_MACRO Header>

    <BODY BGCOLOR=white>
    <CENTER><IMG SRC="/Images/HeaderGraphic.gif" HEIGHT=152 WIDTH=480>
    <P>
    <A HREF="index.html">Home</A> |
    <A HREF="search.html">Search</A> |
    <A HREF="about.html">About</A>
    </CENTER>

    <END_MACRO>
Note the <BEGIN_MACRO>, with the macro's name at the beginning and "Header" and the <END_MACRO> at the end of the macro. These specify the beginning and end of each macro since the NetCloak.macros file may have many different macros in it.

With this header macro defined, updating the navigation links, changing the backgroud or replacing the header graphic only requires changing the macro.

You can also use the MACRO command to insert text or HTML from separate files on the server into your pages. This can be useful for inserting larger amounts of text, or for inserting text that will be changed frequently or is produced by another application on the server. Just specify a file name instead of the name of a macro defined in the NetCloak.macros file.

Almost all of NetCloak's Commands

Now that you have learned the basics, you can start to learn and apply other NetCloak commands on your own. To get you started, here is a page that demonstrates almost all of NetCloak's commands. Some you will understand right away. For others you may need to refer to the User's Guide for an explanation.

Full NetCloak Command Page


[ Move On To The User's Guide | Return To The Getting Started Page ]