4.9.1 :: Linking between WAPL files

Description


While <easyLink> will get you started with a link, if you need more control over where your link is positioned and formatting, use the <link> or <externalLink>
The <link> element allows you to link to the location of another WAPL file rather than a specified URL, it allows you to build a site with XML files rather than have to worry about actual URLs.

Quick Example


..snip..
  1.   <row>
  2.   <cell>
  3.   <link>
  4.   <label>go to page 2</label>
  5.   <prefix>Click here to </prefix>
  6.   <url>http://wapl.info/files/examples/linking_wapl_2.xml</url>
  7.   </link>
  8.   </cell>
  9.   </row>
..snip..

Child Elements


url


The destination of the link. This should be a valid WAPL XML file.

Example:

<link>
<url>http://your-domain.com/file1.xml</url>
</link>

label


The clickable link text.

Example:

<link>
<label>My Link Label</label>
</link>


var


Passes a named variable and value into your own WAPL file. This is useful if your WAPL is generated dynamically. The variable will be available to your dynamic script through _GET. You can pass as many <var> elements as you want, to list them, place the elements inside a <linkVar> parent element.

Example:

<link>
<linkVars>
<var>
<name>test</name>
<value>1</value>
</var>
</linkVars>
</link>

insertion


Adds text into your link urls, between the domain name and the destination file. This can be useful for search engine optimisation.
http://yourdomain.com/go.php?lk=2bc0a6e8&svi=10599&NMSS10599=j32h7uhp3dpnpp0665jbrd71d0
becomes
http://yourdomain.com/2008/11/03/four-hurt-in-lorry-smash/go.php?lk=2bc0a6e8&svi=10599&NMSS10599=j32h7uhp3dpnpp0665jbrd71d0

Example:

<link>
<insertion>2008/11/03/four-hurt-in-lorry-smash/</insertion>
</link>

suffix


Adds text after the link.

Example:

<link>
<suffix>some text that i want before the link</suffix>
</link>

prefix


Adds text before the link.

Example:

<link>
<prefix>this text will appear after the link</prefix>
</link>

id


Specify an id for your link so that you can use a style sheet to change the way it looks.

Example:

<link id="contactUsLink">

accessKey


Specify an access key on the phone to assign to this link. Valid values are 0-9.

Example:

<link>
<accessKey>1</accessKey>
</link>

externalImage


Specify an image to place in the link instead of text. The format for specifying an image inside a link is the same as the externalImage element. For more information about this, please see the <externalImage> element.

Example:

<link>
<externalImage scale="10" filetype="png" quality="90" do_cache="0" class="linkImage">
<url>http://wapl.info/img/header_wapple.png</url>
</externalImage>
</link>

class


Specify a class for your link so that you can use a style sheet to change the way it looks.

Example:

<link class="bigLink">

Detailed Example


..snip..
  1.   <row>
  2.   <cell>
  3.   <link>
  4.   <url>http://wapl.info/files/examples/linking_wapl_2.xml</url>
  5.   <insertion></insertion>
  6.   <suffix></suffix>
  7.   <label>go to page 2</label>
  8.   <prefix>Click here to </prefix>
  9.   <accessKey>1</accessKey>
  10.   <linkVars>
  11.   <var>
  12.   <name>myvar</name>
  13.   <value>1</value>
  14.   </var>
  15.   </linkVars>
  16.   </link>
  17.   </cell>
..snip..

Contents