Wrap text
Report abuse
Main template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<select name="o">
<xsl:call-template name="search_option">
<xsl:with-param name="value">title</xsl:with-param>
<xsl:with-param name="visible">Title</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="search_option">
<xsl:with-param name="value">^title</xsl:with-param>
<xsl:with-param name="visible">--Ascending</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="search_option">
<xsl:with-param name="value">-title</xsl:with-param>
<xsl:with-param name="visible">--Descending</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="search_option">
<xsl:with-param name="value">price</xsl:with-param>
<xsl:with-param name="visible">Price</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="search_option">
<xsl:with-param name="value">^price</xsl:with-param>
<xsl:with-param name="visible">--Ascending</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="search_option">
<xsl:with-param name="value">-price</xsl:with-param>
<xsl:with-param name="visible">--Descending</xsl:with-param>
</xsl:call-template>
</select>
|
search_option template helper
1
2
3
4
5
6
7
8
9
10
11
12
|
<xsl:template name="search_option">
<xsl:param name="value" />
<xsl:param name="visible" />
<xsl:choose>
<xsl:when test="query/order = $value">
<option value="{$value}" selected="selected"><xsl:value-of select="$visible"/></option>
</xsl:when>
<xsl:otherwise>
<option value="{$value}"><xsl:value-of select="$visible"/></option>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
|