[ic] Problem with match-no match
Zambra
michael at zambra.com
Sat Nov 18 07:57:31 EST 2006
Hello,
I have the following search component:
<!-- BEGIN COMPONENT [control component Caja_busqueda_superior] -->
<form action="[area search]" method=post>
<input type=hidden name=mv_session_id value="[data session
id]">
<INPUT TYPE=hidden NAME=mv_searchtype VALUE=db>
<INPUT TYPE=hidden NAME=mv_matchlimit VALUE=[control matches 25]>
<INPUT TYPE=hidden NAME=mv_sort_field VALUE=description>
<!-- INPUT TYPE=hidden NAME=mv_min_string VALUE=3 -->
<INPUT type=text NAME=mv_searchspec>
<select name="mv_search_field" size="1">
<option value="description">[L]PorArtista[/L]</option>
<option value="title">[L]PorTitulo[/L]</option>
</select>
<input type="submit" name="submit" value="[L]Busca[/L]">
</form>
<!-- END COMPONENT [control component Caja busqueda superior] -->
and use the following show results component based on a "more list".
This piece of code is for testing purposes and maybe a little bit hard
to read. I still have to apply a CSS and remove the font tags. The :
!-- BEGIN COMPONENT [control component resultados_busq_carrito] -->
[search-region]
[on-match]
[set name=dolar interpolate=1][data table=locale col=en_US
key=PriceDivide][/set]
<table width="100%" border="0" cellspacing="0" cellpadding="8">
<tr>
<td align="right" valign="bottom"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2" color="#000000"><a href="#nb">[L]New
search[/L]</a></font>
</td>
</tr>
<tr>
<td align="left" valign="bottom"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2" color="000000"><b>[L]Search
results[/L]: <font color="CC0000">[value
mv_search_match_count]</font></b>
[more-list 0 0 0]
[first-anchor][L]First[/L][/first-anchor]
[next-anchor][L]Next[/L][/next-anchor]
[prev-anchor][L]Previous[/L][/prev-anchor]
[last-anchor][L]Last[/L][/last-anchor]
[page-anchor]$PAGE$[/page-anchor]
| <b>[L]Showing results[/L] <font color="CC0000">
[matches]</font></b>
| <b>[more]</b></font>
[/more-list]
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="7">
<tr>
<td bgcolor="#FFCC66"><font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="000000"><b>[L]Author[/L]</b></font></td>
<td bgcolor="CCFF99"><font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="000000"><b>[L]Title[/L]</b></font></td>
<td align="center" bgcolor="FFFF99" width="90"><font face="Verdana,
Arial, Helvetica, sans-serif" size="2"
color="000000"><b>[L]Format[/L]</b></font></td>
<td align="center" bgcolor="FF9999" width="70"><font face="Verdana,
Arial, Helvetica, sans-serif" size="2"
color="#000000"><b>[L]Price[/L]</b></font></td>
<td bgcolor="#FFCC99" width="50"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2"
color="000000"><b>[L]Availability[/L]</b></font></td>
<td align="center" bgcolor="66CCFF" width="40"><font face="Verdana,
Arial, Helvetica, sans-serif" size="2"><b>[L]Buy[/L]</b></font></td>
</tr>
[search-list]
<tr align="left" valign="top">
[item-change 1]
[condition][item-field description][/condition]
<td><font size="2" face="Verdana, Arial, Helvetica,
sans-serif"><b>[item-description]</b></font>
</td>
[else]
<td> </td>
[/else]
[/item-change 1]
<td><font size="2" face="Verdana, Arial, Helvetica,
sans-serif"><b><a href="[area [item-code]]">[item-field title]</a></b><br>
[item-field sello] [item-field refprov]</td>
<td><font size="2" face="Verdana, Arial, Helvetica,
sans-serif"><b><FONT COLOR="red"></FONT> <img
src="/img/shop/icon-cd.gif" valign="bottom" alt="CD"><font size="2"
face="Verdana, Arial, Helvetica, sans-serif"> <b>[item-field
formato]</b></font></b></font></td>
<td width="10%" nowrap><font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="orange"><b>
[setlocale currency=es_ES]
[price [item-code]]
</b></font><br><font face="Verdana, Arial, Helvetica, sans-serif"
size="2" color="CC0000"><b>
[setlocale currency=en_US]
[price [item-code]]
</b></font></td>
<td align="center" nowrap>
[item-calc]
my $q = q{[item-data inventory quantity]};
if($q > 0) {
return <<EOF;
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"
color="#008000"><b>[L]Yes[/L]</b></font>
EOF
}
else {
return <<EOF;
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"
color="#008000"><a href="[area stock-alert
[item-code]]"><b>[L]No[/L]</b></a></font>
EOF
}
[/item-calc]
</td>
<td align="center"><font face="Verdana, Arial, Helvetica,
sans-serif" size="2" color="000000">[order [item-code]]<img
src="/img/shop/scart.gif" width="13" height="11" hspace="2"
border="0"><br>[L]Into Cart[/L]</a></font></td>
</tr>
[/search-list]
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" background="/img/dots2.gif"><img src="/img/o.gif"
width="1" height="1"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="8">
<tr>
<td align="left" valign="bottom"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2" color="000000"><b>[L]Search
results[/L]: <font color="CC0000">[value
mv_search_match_count]</font></b>
[more-list 0 0 0]
[first-anchor][L]First[/L][/first-anchor]
[next-anchor][L]Next[/L][/next-anchor]
[prev-anchor][L]Previous[/L][/prev-anchor]
[last-anchor][L]Last[/L][/last-anchor]
[page-anchor]$PAGE$[/page-anchor]
| <b>[L]Showing results[/L] <font color="CC0000">
[matches]</font></b>
| <b>[more]</b></font>
[/more-list]
</td>
</tr>
</table>
<br>
[/on-match]
[no-match]
No results.
[/no-match]
[/search-region]
<!-- END COMPONENT [control component resultados_busq_carrito] -->
I have the following problems with it:
1. The [no-match] [/no-match] bit does not appear in the component edit
page of the administration section, although it is contained in the
corresponding component file under templates/components. Whenever I type
it in and republish in the UI, this bit has disappeared the next time I
review the component's content.
2. The search results component is being processed by the template
engine so that the text between the [no-match] tags is not being shown
in the event of an empty results list.
Do you know what I might be doing wrong?
Thanks in advance for any hints.
Miguel
zambra.com
More information about the interchange-users
mailing list