| Java menu knowledge base XIXL - Beginner's Tutorial
This page explains how to write a very simple XIXL index for
your applet menu.
- Getting the template
- Examining the template
- Changing the text and links
- Adding entries
- Getting your applet to read it
Step A
Getting the template.
- Download this template (click on the word "template").
- Unzip the template from the zip file. An unzipper is available from
winzip
- You should find a single file inside called menu.txt. Load it into
a simple text viewer such as the Windows Notepad. Normally a simple click on
the file name should load it into such a viewer.
Step B
Examining the template.
- It should look like this.
"TEXT:My Folder" "1" "" "" "My first comment"
"TEXT:My First Page" "2" "" "LINK:myPage1.htm,myFrame" "My second comment"
"TEXT:My Second Page" "2" "" "LINK:myPage2.htm,myFrame" "My third comment"
"TEXT:My Third Page" "2" "" "LINK:myPage3.htm,myFrame" "My fourth comment"
"TEXT:My Fourth Page" "2" "" "LINK:myPage4.htm,myFrame" "My fifth comment"
- This makes a 5-entry index file. If you load it into one of our
tree menus, you get a single folder which contains four entries. If
you load it into one of our pop-up menus, there is one entry in the
first panel, which opens up a submenu with four further entries.
- When the index is loaded into any of our applets, a click
on any of the four page entries will load the pages myPage1.htm, myPage2.htm,
myPage3.htm or myPage4.htm respectively into a frame called "myFrame". If
there is no frame called "myFrame", a new browser window will br created for
the pages.
- When you move the mouse over the entries, the comments
"my first comment", etc., appear in the browser status bar (along the bottom
of the screen).
Step C
Changing the text and links.
- Change the bit
TEXT:My folder
to
TEXT:My top folder.
This will change the text which appears on the applet.
- Change the bit
LINK:myPage1.htm,myFrame
to
LINK:links.htm,_top.
This will change the hyperlink: a click now loads your
page called links.htm into the same window
or frame as you are currently using.
- Change the bit
"My first comment"
to
"This is my top folder".
This will change the status bar text when the mouse moves over the entry.
Step D
Adding entries.
- At the bottom of the menu, add the following:
"TEXT:My Fifth Page" "2" "" "LINK:myPage5.htm,myFrame" "My sixth comment"
This will add another entry in the same folder as the previous
four entries.
- At the bottom of the menu, add the following:
"TEXT:My Second Folder" "1" "" "" "Another comment"
"TEXT:My Sixth Page" "2" "" "LINK:myPage6.htm,myFrame" ""
This will add a second folder to the menu (called "my second folder"), containing one entry
(called "my sixth page"). Note carefully: the number between the second pair of "" changes!
This number marks the indentation level and is used for making folders and submenus.
"1" makes an entry at the top level. "2" makes an entry at the second level.
- Between the entries "my third page" and "my fourth page", add the following:
"TEXT:Page Three-and-a-half" "3" "" "LINK:myPage3a.htm,myFrame" ""
Note that where we previously had "1" and "2" we now have "3". This makes this
entry a submenu of the entry just above it. So "my third page" now
becomes a folder (automatically), and "page three-and-a-half" opens out
from it.
Step E
Getting your applet to read the index.
- Upload your changed file to the same directory as the applet.
Ensure it is still called "menu.txt".
- With "Mini" applets, you don't need to do anything more - the
applet will find the index by itself.
- With "Express", "Pro" and other applets, you will need to add
something like the following to the HTML to tell the applet where
to find the index:
<param name=menufile value="menu.txt">
.
Make sure you read the individual applet documentation to check this.
Find out more about XIXL here.
|
|