Can this be done without switching templates? Is there something I can check in the template to tell me if im checking out?
Can this be done without switching templates? Is there something I can check in the template to tell me if im checking out?
You can check the current page name (it's returned in the XML that is returned in the xmlpackage...just set debug="true" in the package to see where). You could check that page name for the checkout pages and as long as it's not one of those pages then process the rest of the xmlpackage.
<a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>
Thanks George for your input.
I need to do something similar but dont understand how the xml would work.
are u able to give a example of the xml please.
I have a bar I want to remove when Im in cart.
thank you
It seems this can be accomplished as George is saying, by checking against the page name. This would assume that your menu or object is actually being output from an xmlpackage.
Here is an example XmlPackage we did, based on a client's spec, that checks a couple things. It might give you an idea of how to accomplish your needs. It's also handy to use xsl:choose to select classes on your html elements, which allow you to control your layout with CSS - so, when a condition is met (pagename) then you apply this certain class.
1. Check to see if the customer is logged in, and if not, shows an Order Status link. If they are logged in, it shows the My Account link. and
2. Only show the Account page link when not on the account page
HTML Code:<?xml version="1.0" ?> <package displayname="Vibe Commerce Navigation" version="1.0" debug="false" includeentityhelper="false"> <PackageTransform> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf"> <xsl:output method="html" omit-xml-declaration="yes" /> <xsl:param name="Page"> <xsl:value-of select="/root/System/PageName" /> </xsl:param> <xsl:template match="/"> <li> <a href="/">Home</a> </li> <li> <a href="t-customerservice.aspx"> <![CDATA[Customer Care]]> </a> </li> <xsl:choose> <xsl:when test="/root/System/CustomerIsRegistered = 'false'"> <li> <a href="account.aspx#imgOrderhistory">Order Status</a> </li> <xsl:if test="$PageName != 'account.aspx'"> <li> <a href="account.aspx"> <![CDATA[My Account]]> </a> </li> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$PageName != 'account.aspx'"> <li> <a href="account.aspx"> <![CDATA[My Account]]> </a> </li> </xsl:if> <li> <a href="signout.aspx"> <![CDATA[Logout]]> </a> </li> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> </PackageTransform> </package>
Chris McKellar
Vibe Commerce
AspDotNetStoreFront DevNet Partner
AspDotNetStoreFront Add Ons
AspDotNetStoreFront Customization
thanks chris for the nice info, I hall have loads of fun with it