Introduction
In part 3 I showed you how to create a basic WAP site with one page and some text. This week I will show you how you can make this better by adding extra parts, linking to them (and other sites) and how to add images to your site.
More Cards
As I explained in the second part of this tutorial, WAP sites have cards instead of pages. They are really the same as pages except they can all be written in one file. To add another card, all you need to do is put in another <card> tag with a different ID to the others. For example:
<card title="About Me" id="about">
information
</card>
would be added below the first card but before the </wml> tag.
Linking
There are three ways to link to another WAP site, file or card. Just like in HTML these can either be the full path to a file or a relative link.
To link to a WAP site you use the following:
<a href="http://muneerwap.peperonity.com/">MuneerWAP</a>
in your text. To link to another file on your site you would use:
<a href="links.wml">My Links</a>
and to link to another card in the same page you use:
<a href="#about">About Me</a>
Images
Unfortunately, because WAP phones only have limeted size of screens, images do not work very well on WML pages. Some monochrome phones use their own image format: WBMP. When you are creating an image to use on your site you will need to make it small (mobile phone screens are about 128x128, 128x96 or little bigger pixels).
The easiest way to get an image into the WBMP format is to create it as a GIF or JPG (it can be in color if you want) and then visit Teraflops.com to convert it into a monochrome (black and white) WBMP image which you can then include on your site. Or you can use JPEG, GIF and PNG format for new types of mobile which are on use todays.
Images are inserted using the <img> tag, just like in HTML:
<img src="logo.wbmp" alt="Logo" />
Again, you can see that a / has been added at the end as the <img> tag has no closing tag. It is very important that you also include the alt text as it will be displayed while the image is being downloaded. |