Previous Chapter
Next Chapter
Table of Contents
Index

Example 1
Example 2
Example 3

Example section


The following section gives some examples of how and when you can use the tags presented in the previous chapters. The aim is to give you a rough idea about what you can do to get the most out of your web server.
Example 1
Example 1 illustrates one application of the apre tag as well as the use of a macro. This markup will give the user freedom to choose between seeing the page in English with or without images or in Swedish with or without images.

Example 2
Example 2 shows how you can create nifty access counters by combining the Gtext and the accessed tags.

Example 3
This example resembles Example 1. Just like in the above example the user can choose between seeing the pages in English or in Swedish, with or without images. But here the user can also choose whether he wants to have a dark or light background. Note that in this example the java script will only be shown if the client supports Java scripts.

Example 1

The following example shows one application of the apre tag as well as the use of a macro.

<html>
<body bgcolor="#ffffff">
<if prestate=images>
<if prestate=en>
<apre -images>Disable images</apre>
</if>
<if not prestate=en>
<apre -images>Slå av bilder</apre>
</if>
</if>

<if not prestate=images>
<if prestate=en>
<apre images>Enable images</apre>
</if>
<if not prestate=en>
<apre images>Slå på bilder</apre>
</if>
</if>

<if prestate=en>
<apre -en sv>Swedish</apre>
<otherwise>
<apre en -sv>English</apre>
</if>

<hr><noshade>

<if not prestate=images>
<define name=image>alt</define>
<define name=image2>alt</define>
</if>
<else>
<define name=image><img src=image></define>
<define name=image2><img src=image2</define>
</else>

<if prestate=en>
<insert name=image image="infovav.gif" alt="Powered by Roxen"> <center><font size=5>Welcome to Idonex</font></center><p>
The world is still round and business is always local..<p>

Here comes a figure showing the Roxen configuration interface. <insert name=image2 image2="focusing.gif" alt="focus">
</if>

<if not prestate=en>
<insert name=image image="infovav.gif" alt="Powered by Roxen">
<center><font size=5>Välkommen till Idonex</font></center><p>
Idonex jobbar inom flera olika områden..<p>

Här kommer en bild från Roxens konfigurationsgränssnitt. <insert name=image2 image2="focusing.gif" alt="focus">
</if>
</body>
</html>

This markup will display as:

Slå av bilder English


Välkommen till Idonex

Idonex jobbar inom flera olika områden..

Här kommer en bild från Roxens gränssnitt.

Clicking on the "English" link will display the page in English. As you see you also have the choice of seeing the page with our without images. Clicking on the Enable images link will in this case make the images appear.


Example 2

Combining Gtext and the <accessed> tag, an example of a nifty access counter: The following markup:

<gtext nocache nfont=mistral shadow=100,1 spacing=4quant=200 textscale=red,red,yellow,yellow outline=black,1><accessed lang=english type=string></gtext>

will display:

three thousand seven hundred thirteen


Example 3

In this example, just like in Example 1 the user can choose between seeing the pages in English or in Swedish, with or without images. But here the user can also choose whether he wants to have a dark or light background. There is however something else that deserves a special mention. In this example the default is to show the page with images, which is not the case in Example 1 where the user has to click on the Images link before any images are displayed. Notice also that in this example the Java script will only be shown if the client supports Java scripts.

<if not prestate=lowbg>
<body bgcolor=white>
</if>
<else>
<body bgcolor=black text=white link=lightgreen vlink=lightgreen alink=red>
</else>

<define name=pretoggle>
<if prestate=the_prestate>
<if not prestate=en>
<apre -the_prestate><gtext 3 bevel=1>swedish_off</gtext></apre>
</if>
<if prestate=en>
<apre -the_prestate><gtext 3 bevel=1>english_off</gtext></apre>>
</if>
<otherwise>
<if not prestate=en> <apre the_prestate><gtext 3 bevel=1>swedish_on</gtext></apre>
</if>
<if prestate=en>
<apre the_prestate><gtext 3 bevel=1>english_on</gtext></apre>
</if>
</if>
</define>

<insert name=pretoggle the_prestate=lowbg

swedish_off="Ljus bakgrund"
swedish_on="Mörk bakgrund"

english_off="Light background"
english_on="Dark background">
<if supports=javascript> <insert name=pretoggle the_prestate=nojava

swedish_off="Slå på javascript"
swedish_on="Slå av javascript"
english_off="Enable javascript" english_on="Disable javascript">
</if>
<insert name=pretoggle the_prestate=noimages

swedish_off="Bilder"
swedish_on="Inga bilder"

english_off="Images"
english_on="No Images">

<if prestate=en>
<apre -en sv><gtext 3 bevel=1>Swedish</gtext></apre>
<otherwise>
<apre en -sv><gtext 3 bevel=1>English</gtext></apre>
</if>

<hr noshade>

<if not prestate=noimages><pr size=large color=blue></if>

<if prestate=en>
<if not prestate=nojava>
<gtext magic>The Contents</gtext>
</if>
<else>
<gtext>The Contents</gtext>
</else>
<otherwise>
<if not prestate=nojava>
<gtext magic>Innehållet</gtext>
</if>
<else>
<gtext>Innehållet</gtext>
</else>
</if>

This markup will display as:

Ljus bakgrund Slå av javascript Bilder English


Innehållet

Previous Chapter
Next Chapter
Table of Contents
Index