Links in WAPL
Links allow users to navigate from one page to another.
- <?xml version="1.0" encoding="UTF-8" ?>
- <wapl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://wapl.wapple.net/wapl.xsd">
- <head>
- <title>My First WAPL</title>
- </head>
- <layout>
- <easyExternalImage filetype="png" scale="50">
- <url>http://wapl.info/img/logo.png</url>
- </easyExternalImage>
- <easyChars>
- <value>Hello World</value>
- </easyChars>
- <easyLink>
- <label>Click me</label>
- <url>http://wapl.info/files/examples/wapl_is_easy.xml</url>
- </easyLink>
- </layout>
- </wapl>
easyLink element
Like other easy elements, easyLinks are quick, but a bit limited in what they can do.
Our easyLink element is positioned at the bottom of our page, making it the last child of
<layout>.
..snip..- <layout>
- <easyExternalImage filetype="png" scale="50">
- <url>http://wapl.info/img/logo.png</url>
- </easyExternalImage>
- <easyChars>
- <value>Hello World</value>
- </easyChars>
<easyLink>
<label>Click me</label>
<url>http://wapl.info/files/examples/wapl_is_easy.xml</url>
</easyLink>
- </layout>
..snip..
What does it say?
Your
<easyLink> element needs a label. This will be the clickable text of the link.
..snip..- <easyLink>
<label>Click me</label>
- <url>http://wapl.info/files/examples/wapl_is_easy.xml</url>
- </easyLink>
..snip..
This example will show clear instructions: 'Click Me'.
Set your destination
<easyLink> elements need a url to link to. This should be an absolute url to another WAPL document, accessible through http.
..snip..- <easyLink>
- <label>Click me</label>
<url>http://wapl.info/files/examples/wapl_is_easy.xml</url>
- </easyLink>
..snip..
This is the WAPL file that we're linking to. It contains a link back to the first page.
- <?xml version="1.0" encoding="UTF-8" ?>
- <wapl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://wapl.wapple.net/wapl.xsd">
- <head>
- <title>My Second WAPL</title>
- </head>
- <layout>
- <easyChars>
- <value>Wow! WAPL is easy. Well done, you've taken your first steps into a wider world.</value>
- </easyChars>
- <easyLink>
- <label>Show me that cool page again</label>
- <url>http://wapl.info/files/examples/hello_world_4.xml</url>
- </easyLink>
- </layout>
- </wapl>
Notice that once again the url is absolute.