TAG:  template

template
 
The template tag creates a code template that is automatically added to every card in a single deck.
 
Only one template element can occur per deck. This tag can only be contained in a wml element. It can only contain do and onevent elements.
 
The individual card elements can override the behavior specified by the template element. The behavior specified in a template element by a do element can be overridden in a card element by another do element, but only if both do elements have the same name for the name attribute. Likewise, the behavior specified in a template element by an onevent element can be overridden in a card element by using the onenterbackward, onenterforward, and ontimer attributes.
 
Nested Tags: do  onevent
 
Attributes
 
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
 
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
 
onenterbackward
The optional onenterbackward attribute provides the URL or URN that is to be loaded into the browser when the user navigates back into the card using a prev task. The URL or URN usually cannot exceed 255 characters in length.
 
onenterforward
The optional onenterforward attribute provides the URL or URN address that is to be loaded into the browser when the user navigates into a card using a go task. The URL or URN usually cannot exceed 255 characters in length.
 
ontimer
The optional ontimer attribute provides the URL or URN address that is to be loaded into the browser when the timer tag expires for the current card. The URL or URN usually cannot exceed 255 characters in length.
 
This example uses the do tag to add a "back" hyperlink to each card. However, the use of the noop tag prevents the display of this back link in card2.
 
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<template>
   <do type="prev" label="back">
      <prev />
   </do>
</template>

<card id="card1" title="Card 1">
<p>
   <a href="#card2">
Go to Card 2</a>
</p>
</card>

<card id="card2" title="Card 2">
<p>
<do type="prev">
   <noop />
</do>
DevGuru is great! </p>
</card>

</wml>

 
This example uses the onevent tag to always navigate to card3 when a onenterbackward event occurs.
 
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<template>
   <onevent type="onenterbackward">
      <go href="#card3" />
   </onevent>
</template>

<card id="card1" title="Card 1">
<p>
   <a href="#card2">
Go to Card 2</a>
</p>
</card>

<card id="card2" title="Card 2">
<p>
DevGuru </p>
</card>

<card id="card3" title="Card 3">
<p>
is great! </p>
</card>

</wml>


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information