Exemple de code d'une catégorie

Voici un exemple de code pour une catégorie. Cet exemple utilise 2 devises (dollars canadiens et dollars américains) et un fichier d'information personnalisé (ce fichier est nommé Info_fr.html).
Vous pouvez vous en servir comme base pour personnaliser vos catégories.

Notez que ce modèle ne fonctionnera pas correctement avec une publication distante, parce que plusieurs images sont codées de façon relative. Si c'est votre cas, vous devriez modifier l'URL de ces images.


<html>
<head>
<title>Catalogue - [[Template:Store.Name]]</title>
<style>
a:hover { color : #0000ff }
</style>
<script LANGUAGE="JavaScript">
<!--
function newWin(url,width,height) {
    window.open(url,"remoteWin","width="+width+",height="+height+",resizable=1,menubar=0,status=0,scrollbars=1");
}
//-->
</script>
</head>
<body background="/MainTemplate/Publish/Template1/Images/fond_magasin.gif" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" text="#000000" link="#000080" vlink="#000080" alink="#FFFFFF">

[[Template:Declare PageNo As Numeric]]
[[Template:Declare Temp1 As Numeric]]
[[Template:Declare Temp2 As Numeric]]

<table border="0" cellpadding="2" width="600">
<tr>
<td width="120" align="left" valign="top">
<p><br></p> <p><br></p> <a href="[[Template:Store.URL]]"><img src="/MainTemplate/Publish/Template1/Images/menu_home.gif" border="0"></a><br> <a href="[[Template:Store.CartURL]]"><img src="/MainTemplate/Publish/Template1/Images/menu_cart.gif" border="0"></a><br> <a href="[[Template:Store.CheckoutURL]]"><img src="/MainTemplate/Publish/Template1/Images/menu_checkout.gif" border="0"></a><br> <a href="[[Template:Store.FileURL Name="Info_fr.html"]]"><img src="/MainTemplate/Publish/Template1/Images/menu_info.gif" border="0"></a><br> [[Template:If Store.Search.Support]]
<form action="[[Template:Store.Search.URL]]" method="POST"> <table border="0" cellpadding="0" cellspacing="1">
<tr>
<td>
<div align="center"> <input type="hidden" name="L" value="1"> <input type="hidden" name="SID" value="[[Template:Store.ID]]"> <input type="text" name="UserRestriction" size="12"><br> <input type="image" alt="Recherche" border="0" src="/MainTemplate/Publish/Template1/Images/recherche.gif"> </div>
</td>
</tr>
</table> </form>
[[Template:EndIf]] <p><br> [[Template:If Store.Language.Support Contains "en"]]
<a href="[[Template:Store.URL Language="en"]]"><img src="/MainTemplate/Publish/Template1/Images/english_version.gif" border="0"></a></p>
[[Template:EndIf]] <img src="/MainTemplate/Publish/Template1/Images/serveur_securise.gif" border="0" WIDTH="76" HEIGHT="43"> <p>&nbsp;</p> <p>
</td> <td width="20">&nbsp;&nbsp;&nbsp;</td> <td valign="top">
<table width="455">
<tr>
<td align="right">
<a href="[[Template:Store.CartURL]]"><img src="/MainTemplate/Publish/Template1/Images/menu_top_cart.gif" border="0"></a>&nbsp; <a href="javascript:newWin('/manuel/acheteur/menu.html',280,510)"><img src="/MainTemplate/Publish/Template1/Images/menu_top_help.gif" border="0"></a>&nbsp;&nbsp; <a href="mailto:youremail@yourdomain.com"><img src="/MainTemplate/Publish/Template1/Images/menu_top_contacts.gif" border="0"></a>
</td>
</tr> <tr>
<td>
<font face="verdana, arial, helvetica" size="3"><br><b>[[Template:Store.Name]]</b><br> <img src="/MainTemplate/Publish/Template1/Images/ligne.gif" border="0" width="455"><br> <font face="verdana, arial, helvetica" size="1"><b>Catalogue</b></font> <p> <font size="2" color="#000080"><strong>[[Template:Category.Name]]</strong></font> <br> [[Template:Category.Loop.Begin]]
<font face="verdana, arial, helvetica" size="1"><b><a href="[[Template:Category.URL]]">[[Template:Category.Name]]</a></b></font> [[Template:If Category.Last EQ False]]
&nbsp;|&nbsp;
[[Template:EndIf]]
[[Template:Category.Loop.End]] <p><br></p>
</td>
</tr>
</table> <table border="0" width="475">
<tr>
<td width="542">
<center>
<table border="0" width="475">
<tr>
<td valign="top" align="texttop"><img src="[[Template:Category.ImageURL]]" align="texttop">&nbsp;&nbsp;</td> <td valign="top"><font face="verdana, arial, helvetica" size="2">[[Template:Category.Description]]</font></td>
</tr>
</table>
</center>
</td>
</tr>
</table> <table border="0" width="475">
[[Template:If Category.NumberOfPages GT 1]]
<tr>
<td colspan="3" align="right">
<font face="verdana, arial, helvetica" size="1"><b>Aller à la Page:  </font> <font face="verdana, arial, helvetica" size="2"> [[Template:If Category.CurrentPageNumber GT 1]]
<A HREF="[[Template:Category.URL(Page=1)]]">1</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Category.CurrentPageNumber GT 11]]
[[Template:Set PageNo=Category.CurrentPageNumber-10]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Category.CurrentPageNumber GT 2]]
[[Template:Set PageNo=Category.CurrentPageNumber-1]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Category.CurrentPageNumber]]&nbsp;&nbsp; [[Template:If Category.CurrentPageNumber LT Category.NumberOfPages]]
[[Template:Set PageNo=Category.CurrentPageNumber+1]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Set Temp1=Category.NumberOfPages-1]] [[Template:Set Temp2=Category.CurrentPageNumber+10]] [[Template:If (Category.CurrentPageNumber LT Temp1) AND (Temp2 GTE Category.NumberOfPages)]]
<A HREF="[[Template:Category.URL(Page=Category.NumberOfPages)]]">[[Template:Category.NumberOfPages]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Set Temp1=Category.NumberOfPages-10]] [[Template:Set Temp2=Category.CurrentPageNumber+10]] [[Template:If (Category.CurrentPageNumber LT Temp1) AND (Temp2 LTE Category.NumberOfPages)]]
[[Template:Set PageNo=Category.CurrentPageNumber+10]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Temp2 LT Category.NumberOfPages]]
<A HREF="[[Template:Category.URL(Page=Category.NumberOfPages)]]">[[Template:Category.NumberOfPages]]</A>&nbsp;&nbsp;
[[Template:EndIf]] </font></b> <hr SIZE="1">
</td>
</tr>
[[Template:EndIf]]
[[Template:Item.Loop.Begin]]
<tr>
<td width="100" height="150">
<a href="[[Template:Item.URL]]"><img src="[[Template:Item.ImageURL Size=Small]]" align="left" border="0"></a>
</td> <td width="335" height="100">
<font face="verdana, arial, helvetica" size="2"> <strong>
[[Template:Item.Name]]<br> <font color="#000080">[[Template:Item.Price CurrencyFormat=True Currency=CAD]] - [[Template:Item.Price CurrencyFormat=True Currency=USD]]</font>
</strong> <br> <font size="1"> [[Template:Item.Description NbCharacters=50 CompleteWord=True]] <a href="[[Template:Item.URL]]"><b>Détails</b></a> <p> [[Template:If Item.HasOption]]
<b>o <a href="[[Template:Item.URL]]">Acheter !</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[[Template:Else]]
<b>o <a href="[[Template:Item.Cart.AddURL]]">Acheter !</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[[Template:EndIf]] </font> </font>
</td>
</tr>
[[Template:Item.Loop.End]] [[Template:If Category.NumberOfPages GT 1]]
<tr>
<td colspan="3" align="right">
<hr SIZE="1"> <font face="verdana, arial, helvetica" size="1"><b>Aller à la Page:  </font> <font face="verdana, arial, helvetica" size="2"> [[Template:If Category.CurrentPageNumber GT 1]]
<A HREF="[[Template:Category.URL(Page=1)]]">1</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Category.CurrentPageNumber GT 11]]
[[Template:Set PageNo=Category.CurrentPageNumber-10]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Category.CurrentPageNumber GT 2]]
[[Template:Set PageNo=Category.CurrentPageNumber-1]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Category.CurrentPageNumber]]&nbsp;&nbsp; [[Template:If Category.CurrentPageNumber LT Category.NumberOfPages]]
[[Template:Set PageNo=Category.CurrentPageNumber+1]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Set Temp1=Category.NumberOfPages-1]] [[Template:Set Temp2=Category.CurrentPageNumber+10]] [[Template:If (Category.CurrentPageNumber LT Temp1) AND (Temp2 GTE Category.NumberOfPages)]]
<A HREF="[[Template:Category.URL(Page=Category.NumberOfPages)]]">[[Template:Category.NumberOfPages]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:Set Temp1=Category.NumberOfPages-10]] [[Template:Set Temp2=Category.CurrentPageNumber+10]] [[Template:If (Category.CurrentPageNumber LT Temp1) AND (Temp2 LTE Category.NumberOfPages)]]
[[Template:Set PageNo=Category.CurrentPageNumber+10]] <A HREF="[[Template:Category.URL(Page=PageNo)]]">[[Template:PageNo]]</A>&nbsp;&nbsp;
[[Template:EndIf]] [[Template:If Temp2 LT Category.NumberOfPages]]
<A HREF="[[Template:Category.URL(Page=Category.NumberOfPages)]]">[[Template:Category.NumberOfPages]]</A>&nbsp;&nbsp;
[[Template:EndIf]] </font></b>
</td>
</tr>
[[Template:EndIf]]
</table> <p> <a href="javascript:history.back()"><img src="/MainTemplate/Publish/Template1/Images/Retour.gif" border="0" width="80" height="25"></a>
</td>
</tr>
</table> </body> </html>