In this step you will complete the coding of the toolbar menu item weblet. You will add code to:
<xsl:template name="iii_toolbar_menuitem"> tag, paste in the following code to define the weblet parameters. Review the comments for each parameter to see where it will be used.<!-- Used to set the Menu Text on the toolbar image -->
<xsl:param name="menu_text" wd:type="std:mtxt_variable" select="'Caption'" />
<!-- Used to set the image use for the toolbar Icon -->
<xsl:param name="menu_image" wd:type="std:html_img_relative"
select="'/icons/normal/16/folder_16.png'" />
<!-- Used to set the ALT tag on the toolbar IMG tag -->
<xsl:param name="tooltip_text" wd:type="std:mtxt_variable"
select="'Caption'" />
<!-- Used to set the Rentry Field Name when the toolbar Icon is clicked -->
<xsl:param name="reentryfield"
wd:type="std:field_name_in[wam=$on_click_wamname][webrtn=$on_click_wrname]"
select="'STDRENTRY'" wd:tip_id="" />
<!-- Used to set the Rentry Field Value when the toolbar Icon is clicked-->
<xsl:param name="reentryvalue" select="'M'" wd:tip_id="" />
<!-- Used to set the Menu Text on the toolbar image -->
<xsl:param name="hide_if" wd:type="std:boolean" select="false()"
wd:tip_id="" />
<!-- Used to specify the WAMNAME to call when toolbar Icon is clicked -->
<!-- It will default to the current WAM if no value is specified -->
<xsl:param name="on_click_wamname" wd:type="std:wam"
select="/lxml:data/lxml:context/lxml:webapplication" wd:tip="" />
<!-- Used to specify the WebRoutine to call when toolbar Icon is clicked -->
<xsl:param name="on_click_wrname"
wd:type="std:webroutine[wam=$on_click_wamname]" wd:tip="" />
<a href="../../../ocument./index.htm" target="_blank"yfield}','{$reentryvalue}');HandleEvent('{$on_click_wamname}','{$on_click_wrname}');">
<img alt="{$tooltip_text}" src="/images/{$menu_image}" border="0" />
<br />
<span class="std_menuitem">
<xsl:value-of select="$menu_text" />
</span>
</a> Note: The <xsl:if> element must have an </xsl:if> end tag. The <xsl:if> must surround the entire <A HREF . . . .> tag. Add the highlighted code only:
|
Hint: The XSL editor autocomplete function will generate the The variable $hide_if is a Boolean, with a default value of 'false' as shown in the parameter definitions. |
<wd:template name="iii_toolbar_menuitem">
<wd:description icon="icons/userdefn.ico">
<wd:name lang="ENG">iii Toolbar Menu Item</wd:name>
</wd:description>
<wd:param name="menu_text">
<wd:tip lang="ENG">Menu Text to display below the image on the toolbar menu item</wd:tip>
</wd:param>
<wd:param name="menu_image">
<wd:tip lang="ENG">Image to display on the toolbar menu item</wd:tip>
</wd:param>
<wd:param name="tooltip_text">
<wd:tip lang="ENG">Tooltip text to display on the toolbar menu item</wd:tip>
</wd:param>
</wd:template>
Note:
|
<xsl:import href="std_types.xsl" /> and add the following line after that line:
<xsl:import href="std_keys.xsl" />
The std_keys XSL defines xsl:key's such as "field-caption" and "field-value" that are used during transformation to extract data from the Data XML output via the WebRoutine.