|
Navigation: SoftCAT FAQ > Upgrading to the latest version > Explorer templates |
![]() ![]()
|
If you want to use your own customized explorer templates from version 4 you need to make some modifications. Another options is to install the new templates, and then re-apply your customizations to the standard templates.
The SoftCAT setup program will ask if you want to install the new explorer templates that ship with SoftCAT v5. If you answer yes, your old template folder is backed up.
Note: You can download a zip file with the new templates from here (softcat5_xsl.zip).
UTF-8
All templates should be updated to use UTF-8 encoding. To do this, change
<?xml version="1.0" encoding="iso-8859-1"?>
to
<?xml version="1.0" encoding="utf-8"?>
and make sure you also save the file with UTF-8 encoding.
You can use this little program to do this automatically (back up your templates first!): ConvertTemplatesToUTF8.exe. Just click the ... button, select the \Explorer Templates folder, then click OK.
Index
Due to the number of changes required in the Index.xsl ("home page") template, we recommend you use the two new index templates: Index.xsl and Index_Statistics.xsl (available in the zip file).
Styles
We recommend you use the new Style.css file you find in the zip file.
GIF files
We recommend you use the updates GIF files you find in the zip file.
Category
To display the new multi-category field, first add this section in Common.xsl (this is a shared function that the other templates will call):
<xsl:template name="format-category">
<xsl:param name="categorylist"/>
<xsl:param name="hyperlink" select="'True'"/>
<xsl:param name="newwindow" select="'False'"/>
<xsl:param name="newline" select="'True'"/>
<xsl:param name="separator1" select="'; '"/>
<xsl:param name="separator2" select="'; '"/>
<xsl:for-each select="$categorylist/category">
<xsl:choose>
<xsl:when test="$hyperlink='True'">
<xsl:choose>
<xsl:when test="$newwindow='True'">
<A HREF="ProgramList.xsl?Category={.}@xslparam:doctitle={/data/fld/category/@name}: {.}" TARGET="_BLANK"><xsl:value-of select="."/></A>
</xsl:when>
<xsl:otherwise>
<A HREF="ProgramList.xsl?Category={.}@xslparam:doctitle={/data/fld/category/@name}: {.}"><xsl:value-of select="."/></A>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$newline='True'">
<xsl:if test="position() < last()">
<BR/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="position() < last() -1">
<xsl:value-of select="$separator1"/>
</xsl:if>
<xsl:if test="position() = last() -1">
<xsl:value-of select="$separator2"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
To display the new category field, replace the old code with a call to "format-category". For example, in ProgramBrowse.xsl, replace
<A HREF="ProgramList.xsl?FullCategory={fullcategory}@xmltitle=Category : {fullcategory}" TARGET="_BLANK">
<xsl:value-of select="fullcategory"/>
</A>
with
<xsl:call-template name="format-category">
<xsl:with-param name="categorylist" select="categorylist"/>
<xsl:with-param name="newwindow" select="'True'"/>
</xsl:call-template>
You need to update the following templates: Program.xsl, ProgramBrowse.xsl, ProgramBrowse_Right.xsl, ProgramList.xsl, ProgramList_Icon.xsl, and ProgramList_PurchaseInfo.xsl.
Replace "fullcategory" with "category", and "category" with "maincategory", in the following templates: Category.xsl, CategoryBrowse.xsl, and CategoryList.xsl.
Platform
To display the new multi-platform field, first add this section in Common.xsl (this is a shared function that the other templates will call):
<xsl:template name="format-platform">
<xsl:param name="platformlist"/>
<xsl:param name="hyperlink" select="'True'"/>
<xsl:param name="newwindow" select="'False'"/>
<xsl:param name="newline" select="'True'"/>
<xsl:param name="separator1" select="'; '"/>
<xsl:param name="separator2" select="'; '"/>
<xsl:for-each select="$platformlist/platform">
<xsl:choose>
<xsl:when test="$hyperlink='True'">
<xsl:choose>
<xsl:when test="$newwindow='True'">
<A HREF="ProgramList.xsl?Platform={.}@xslparam:doctitle={/data/fld/platform/@name}: {.}" TARGET="_BLANK"><xsl:value-of select="."/></A>
</xsl:when>
<xsl:otherwise>
<A HREF="ProgramList.xsl?Platform={.}@xslparam:doctitle={/data/fld/platform/@name}: {.}"><xsl:value-of select="."/></A>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$newline='True'">
<xsl:if test="position() < last()">
<BR/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="position() < last() -1">
<xsl:value-of select="$separator1"/>
</xsl:if>
<xsl:if test="position() = last() -1">
<xsl:value-of select="$separator2"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
To display the new platform field, replace the old code with a call to "format-platform". For example, in ProgramBrowse.xsl, replace
<A HREF="ProgramList.xsl?Platform={platform}@xmltitle=Platform : {platform}" TARGET="_BLANK">
<xsl:value-of select="platform"/>
</A>
with
<xsl:call-template name="format-platform">
<xsl:with-param name="platformlist" select="platformlist"/>
<xsl:with-param name="newwindow" select="'True'"/>
<xsl:with-param name="newline" select="'False'"/>
</xsl:call-template>
You need to update the following templates: Program.xsl, ProgramBrowse.xsl, and ProgramBrowse_Right.xsl.