| View previous topic :: View next topic |
| Author |
Message |
alpha-bid
Joined: 04 Oct 2005 Posts: 120
|
Posted: Thu Jan 12, 2006 8:40 pm Post subject: Modifying a template. |
|
|
How can I produce a template like "packing slips/standard" but ommiting the title bar, store name and store inforamation?
Thanks |
|
| Back to top |
|
Wes Site Admin
Joined: 07 Oct 2002 Posts: 7427
|
Posted: Fri Jan 13, 2006 4:17 pm Post subject: |
|
|
Hello,
The following template would accomlish the desired result:
| Code: | <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">
<sw:settings>
<sw:general>
<sw:context>order</sw:context>
</sw:general>
</sw:settings>
<!-- Use the base Standard Template -->
<xsl:import href="System\Standard Order Template" />
<!-- Specify the template properties -->
<xsl:variable name="templateType" select="'packingslip'" />
<xsl:variable name="showThumbnails" select="false()" />
<xsl:output method="html" encoding="utf-8" />
<xsl:template name="outputPageHeader" />
<xsl:template name="outputBaseTemplateContent">
<!-- If there is not just a single order its an error -->
<xsl:if test="count(//Order) != 1">
<p>
This template is designed to be per-order. There are currently
<xsl:value-of select="count(//Order)" /> orders in the XML input source.
</p>
<p>
Please adjust the template settings to be processed per-order.
</p>
</xsl:if>
<!-- Continue if there is only a single order as input -->
<xsl:if test="count(//Order) = 1">
<xsl:variable name="order" select="//Order[1]" />
<xsl:call-template name="outputPageHeader" />
<table id="headerInfo">
<tr>
<xsl:call-template name="outputHeaderPreAddress" />
<td id="storeAddress">
</td>
<td id="orderinfo">
<div> <!-- This div is used only to provide a border -->
<table cellspacing="0">
<tr><td class="label">Order:</td><td class="value"><xsl:value-of select="$order/Number" /></td></tr>
<tr><td class="label">Placed:</td><td class="value"><xsl:value-of select="sw:ToShortDate($order/Date)" /></td></tr>
</table>
</div>
</td>
</tr>
</table>
<xsl:call-template name="outputShipBillHeader" />
<xsl:call-template name="outputShipToBillTo">
<xsl:with-param name="order" select="$order" />
</xsl:call-template>
<xsl:call-template name="outputOrderDetailsHeader" />
<xsl:call-template name="outputOrderDetails">
<xsl:with-param name="order" select="$order" />
<xsl:with-param name="showThumbnails" select="$showThumbnails" />
<xsl:with-param name="showAmounts" select="$templateType = 'invoice'" />
</xsl:call-template>
<xsl:call-template name="outputOrderDetailsFooter" />
<xsl:if test="$templateType = 'invoice'">
<xsl:call-template name="outputOrderTotalsHeader" />
<xsl:call-template name="outputOrderTotals">
<xsl:with-param name="order" select="$order" />
</xsl:call-template>
</xsl:if>
<div style="width: {//ContentWidth} in;">
<xsl:call-template name="outputPageFooter" />
</div>
<!-- This is the end of the test ensuring a single order -->
</xsl:if>
</xsl:template>
</xsl:stylesheet> |
Please let us know if you have further questions.
Thanks,
Wes
Interapptive, Inc.
Last edited by Wes on Sat Jan 14, 2006 7:36 am; edited 1 time in total |
|
| Back to top |
|
alpha-bid
Joined: 04 Oct 2005 Posts: 120
|
Posted: Fri Jan 13, 2006 4:50 pm Post subject: |
|
|
| Nice! works great. thanks |
|
| Back to top |
|
|