The following WML example illustrates how to use the <template> and <do> element to create a menu that is accessible in all cards of a deck:


(templateEg1.wml)

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

<wml>
  <template>
    <do name="menu_1" type="accept" label="Table of Contents">
      <go href="#tutorial_tc"/>
    </do>
    <do name="menu_2" type="accept" label="Chapter 1">
      <go href="#tutorial_ch1"/>
    </do>
    <do name="menu_3" type="accept" label="Chapter 2">
      <go href="#tutorial_ch2"/>
    </do>
    <do name="menu_4" type="accept" label="Chapter 3">
      <go href="#tutorial_ch3"/>
    </do>
    <do name="menu_5" type="accept" label="Chapter 4">
      <go href="#tutorial_ch4"/>
    </do>
    <do name="menu_6" type="accept" label="About Us">
      <go href="about_us.wml"/>
    </do>
    <do name="menu_7" type="accept" label="Contact Us">
      <go href="contact_us.wml"/>
    </do>
  </template>


  <card id="tutorial_tc" title="WML Tutorial">
    <p>
      Hello, welcome to our WML tutorial.<br/><br/>
      Table of Contents:<br/>

      <anchor>
        <go href="#tutorial_ch1"/>
        Chapter 1: WML Introduction
      </anchor><br/>

      <anchor>
        <go href="#tutorial_ch2"/>
        Chapter 2: WML Deck and Card
      </anchor><br/>

      <anchor>
        <go href="#tutorial_ch3"/>
        Chapter 3: WML Document Structure
      </anchor><br/>

      <anchor>
        <go href="#tutorial_ch4"/>
        Chapter 4: WML Generic Metadata
      </anchor><br/>
    </p>
  </card>

  <card id="tutorial_ch1" title="WML Tutorial Ch1">
    <p>
      <em>Chapter 1: WML Introduction</em><br/><br/>
      ...
    </p>
  </card>

  <card id="tutorial_ch2" title="WML Tutorial Ch2">
    <p>
      <em>Chapter 2: WML Deck and Card</em><br/><br/>
      ...
    </p>
  </card>

  <card id="tutorial_ch3" title="WML Tutorial Ch3">
    <p>
      <em>Chapter 3: WML Document Structure</em><br/><br/>
      ...
    </p>
  </card>

  <card id="tutorial_ch4" title="WML Tutorial Ch4">
    <p>
      <em>Chapter 4: WML Generic Metadata</em><br/><br/>
      ...
    </p>
  </card>
</wml>


Open the above WML example in a WAP browser and you should see something like this:






Sony Ericsson T610








Sony Ericsson T68i





Nokia Mobile Browser 4.0


Press the "More" softkey of the Sony Ericsson T610 mobile phone browser, the "Options menu" button of the Sony Ericsson T68i mobile phone and the "Options" softkey of Nokia Mobile Browser 4 to bring up the menu:






Sony Ericsson T610





Sony Ericsson T68i





Nokia Mobile Browser 4.0


Select the "Chapter 4" item of the menu. The following cards then appear:



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


To navigate to another card, bring up the menu again and select another item:



Sony Ericsson T610


Sony Ericsson T68i


Nokia Mobile Browser 4.0


Previous Page Page 26 of 50 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page