Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 9 of 9

Thread: Category Icons

  1. #1
    MTuttle is offline Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Default Category Icons

    Hello,

    I'm redesigning a site running AspDotNetStorefront ML 8.0.1.2/8.0.1.2 and can't seem to get my category icons to show on the homepage. I've setup the list, which is working fine, but would like to show the icons above the links.

    Here's my progress so far: https://www.davidscottco.com/default.aspx?skinid=3

    Any help would be appreciated.

    Thanks,
    Matt

  2. #2
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default Category Icons

    Hi Matt,

    Are you coding the category list through an XML Package? If so, as long as you have all the parameters correctly filled, you should be able to use the following code to retrieve individual category images:

    Code:
    <xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, $EntityName, 'icon', 0, $AltText)" disable-output-escaping="yes" />
    Parameters explained:
    EntityID = your category ID
    $EntityName = 'Category'
    'icon' = image size
    0 = not used
    $AltText = image alt text

    If you are having trouble with your XML package, feel free to share your code so we can have a look.

    best of luck,
    Robert
    Robert Kanaan
    AspDotNetStorefront Development Partner
    robert@GoVedia.com
    408-758-8845

    GoVedia
    http://GoVedia.com
    Approved AspDotNetStorefront Development Partner
    AspDotNetStorefront Recommended Reseller

  3. #3
    MTuttle is offline Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Default No Luck Yet

    Hi GoVedia,

    Thanks for the reply, I took the code you shared and tried to insert it into an xml package that I am working on and it didn't seem to take. Here's the whole thing:

    Code:
    <?xml version="1.0" standalone="yes" ?>
    <!-- ###################################################################################################### -->
    <!-- Copyright AspDotNetStorefront.com, 1995-2009.  All Rights Reserved.					                -->
    <!-- http://www.aspdotnetstorefront.com														                -->
    <!-- For details on this license please visit  the product homepage at the URL above.		                -->
    <!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
    <!-- ###################################################################################################### -->
    <package version="2.1" displayname="Categories" debug="false" includeentityhelper="true">
    	<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="CategoryID">
    				<xsl:choose>
    					<xsl:when test="/root/System/PageName = 'showmanufacturer.aspx' or /root/System/PageName = 'showsection.aspx' or /root/System/PageName = 'showdistributor.aspx' or /root/System/PageName = 'showvector.aspx' or /root/System/PageName = 'showgenre.aspx'">0</xsl:when>
    					<xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)">
    						<xsl:value-of select="/root/QueryString/categoryid"/>
    					</xsl:when>
    					<xsl:when test="(/root/System/PageName = 'showcategory.aspx' or /root/System/PageName = 'showproduct.aspx') and boolean(/root/Cookies/lastviewedentityinstanceid) and /root/Cookies/lastviewedentityname = 'Category'">
    						<xsl:value-of select="/root/Cookies/lastviewedentityinstanceid"/>
    					</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    
    			<xsl:param name="AncestorID">
    				<xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID and Name = 'Consumer']">
    					<xsl:value-of select="ancestor::*/EntityID"/>
    				</xsl:for-each>
    			</xsl:param>
    
    			<xsl:param name="ParentID">
    				<xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
    					<xsl:value-of select="parent::*/EntityID"/>
    				</xsl:for-each>
    			</xsl:param>
    
    			<xsl:template match="/">
    				<xsl:element name="ul">
    					<xsl:attribute name="class">
    						<![CDATA[tame2]]>
    					</xsl:attribute>
    
    					<xsl:apply-templates select="/root/EntityHelpers/Category/Entity">
    						<xsl:with-param name="prefix" select="''"/>
    						<xsl:with-param name="level" select="1"/>
    					</xsl:apply-templates>
    
    				</xsl:element>
    			</xsl:template>
    			
    			<xsl:template match="Entity">
    				<xsl:param name="prefix"></xsl:param>
    				<xsl:param name="eName" select="aspdnsf:GetMLValue(Name)" />
    				<xsl:param name="level"/>
    	
    				<xsl:choose>
    					<!--On specific page show categories only the second level under every industry-->
    					<!--Don't know how api work. so check the page name what will list only second level from every industry-->
    					<xsl:when test="(/root/System/PageName = 'default.aspx') or 
    									(/root/System/PageName = 'Default.aspx') or 
    									 (/root/System/PageName = 'shoppingcart.aspx') or
    									 (/root/System/PageName = 'ShoppingCart.aspx') or
    									 (/root/System/PageName = 'checkoutshipping.aspx') or
    									 (/root/System/PageName = 'checkoutpayment.aspx') or
    									 (/root/System/PageName = 'checkoutreview.aspx') or
    									 (/root/System/PageName = 'orderconfirmation.aspx') or
    									 (/root/System/PageName = 'showproduct.aspx') or
    									 (/root/System/PageName = 'account.aspx') or
    									 (/root/System/PageName = 'wishlist.aspx') or
    									 (/root/System/PageName = 'driver.aspx')">
    								<xsl:for-each select="Entity">
    									<li class="li_hpcat">
    									<xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, $EntityName, 'icon', 0, $AltText)" disable-output-escaping="yes" />
    									<a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
    										<xsl:value-of select="Name"/>
    									</a>
    									</li>
    								</xsl:for-each>
    					</xsl:when>
    
    					<!--Default: Show only specific category from Second level-->
    					<xsl:otherwise>
    						
    						<!--for debug <xsl:value-of select="$level"/>-->
    						<xsl:choose>
    							<!--If first level(Industry), don't show-->
    							<xsl:when test="number($level) = 1">
    								<xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
    									<ul class="tame2">
    										<xsl:apply-templates select="Entity">
    											<xsl:with-param name="prefix" select="concat($prefix, '')"/>
    											<xsl:with-param name="level" select="number($level) + 1"/>
    										</xsl:apply-templates>
    									</ul>
    								</xsl:if>
    							</xsl:when>
    							
    							<!--If other level(Sub-category), show-->
    							<xsl:otherwise>
    								<li class="li_hpcat">
    									<xsl:value-of select="$prefix" />
    									<xsl:if test="number(ParentEntityID) != 0">
    										<div id="mainImg">
                    						<xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, $EntityName, 'icon', 0, $AltText)" disable-output-escaping="yes" />
                  							</div>
    										<a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
    											<xsl:value-of select="$eName"/>
    										</a>
    									</xsl:if>
    
    									<xsl:if test="count(child::Entity)&gt;0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
    										<ul class="tame2">
    											<xsl:apply-templates select="Entity">
    												<xsl:with-param name="prefix" select="concat($prefix, '')"/>
    												<xsl:with-param name="level" select="number($level) + 1"/>
    											</xsl:apply-templates>
    										</ul>
    									</xsl:if>
    								</li>
    							</xsl:otherwise>
    						</xsl:choose>
    						
    
    					</xsl:otherwise>
    				</xsl:choose>
    				
    			</xsl:template>
    
    		</xsl:stylesheet>
    	</PackageTransform>
    </package>
    I appreciate any help you can give so I can call category images into the list I'm setting up on my homepage.

    Thanks,
    Matt

  4. #4
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default Missing Parameters

    Matt,

    It inst working because you are missing two parameters. Try this instead:
    Code:
    <xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, 'Category', 'icon', 0, '')" disable-output-escaping="yes" />
    Let me know if that works,
    Robert
    Robert Kanaan
    AspDotNetStorefront Development Partner
    robert@GoVedia.com
    408-758-8845

    GoVedia
    http://GoVedia.com
    Approved AspDotNetStorefront Development Partner
    AspDotNetStorefront Recommended Reseller

  5. #5
    MTuttle is offline Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Default Thanks!

    That did it! Do you know if it's possible to move the "News" to the sidebar? Where is that function located?

  6. #6
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default News XML Package

    Matt,

    Your news is most likely being pulled in through your page.default.xml.config XML package. Look for the following:

    Code:
    <xsl:value-of select="aspdnsf:XmlPackage('news.xml.config')" disable-output-escaping="yes"/>
    To place it in the side bar, insert the following code in your template ascx file.
    Code:
    (!XmlPackage Name="news.xml.config"!)
    You will want to place it within the following div: <div id="leftWrap">

    Robert
    Robert Kanaan
    AspDotNetStorefront Development Partner
    robert@GoVedia.com
    408-758-8845

    GoVedia
    http://GoVedia.com
    Approved AspDotNetStorefront Development Partner
    AspDotNetStorefront Recommended Reseller

  7. #7
    MTuttle is offline Junior Member
    Join Date
    Oct 2012
    Posts
    26

    Default One more question

    Hey Robert,

    You've been a big help so far, thanks! I do have another question though, how would I call the company name ( Dispatch_SiteName ?) into the template? The old site was using an image logo, and I'd like to setup a text based one.

    Matt

  8. #8
    SEOrockstar is offline Junior Member
    Join Date
    Feb 2013
    Posts
    6

    Default Question about the grid layout for homepage.

    Hi

    This is exactly what I'm trying to accomplish with my site. I added code spoke about above but the only categories that are displaying on the home page are 2 sub categories that i have in another category. (These are the only subcategories i have in the whole website.) How would i display only root level categories?

  9. #9
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Please see this same issue discussed here:
    http://forums.aspdotnetstorefront.co...d=1#post246800
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM