Adding Category Description to CategoryGridPage

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
webmaz
Lieutenant (LT)
Lieutenant (LT)
Posts: 52
Joined: Wed Apr 14, 2010 3:57 pm

Adding Category Description to CategoryGridPage

Post by webmaz » Mon Sep 15, 2014 3:09 pm

I'm trying to customize the CategoryGridPage to include the category description.
I have tried using code from CategoryGridPage4 and code from this forum post: viewtopic.php?f=42&t=17583&p=75683 but neither option has worked.

I receive the error:
[[ConLib:CategoryGridPage]] CategoryGridPage.ascx.cs(100): error CS0103: The name '_Category' does not exist in the current context

I've tried several different variations and nothing works.
I am not a programmer. Could someone point me in the right direction?

Right now the code behind file contains:

Code: Select all

       private void BindPage()
        {	
            //BIND THE DISPLAY ELEMENTS
            if (IsValidCategory())
            {
                CategoryBreadCrumbs1.Visible = DisplayBreadCrumbs;
                CategoryBreadCrumbs1.CategoryId = this._categoryId;
                if (_category != null)
                {
                    Page.Title = string.IsNullOrEmpty(_category.Title) ? _category.Name : _category.Title; 
                    Caption.Text = _category.Name;
				
				//Added for category description
				if (!string.IsNullOrEmpty(_Category.Description))
				{
				CategoryDescriptionPanel.Visible = true;
				CategoryDescription.Text = _Category.Description;
				}
				else CategoryDescriptionPanel.Visible = false;
				//END category description
				
                }
                else
                {
                    // IF IT IS ROOT CATEGORY
                    Page.Title = DefaultCaption;
                    Caption.Text = DefaultCaption;
                }
				
                BindSubCategories();
            }
            else
            {
                CategoryHeaderPanel.Visible = false;
            }

            BindSearchResultsPanel();
        }

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Adding Category Description to CategoryGridPage

Post by mazhar » Tue Sep 16, 2014 12:44 am

CategoryGridPage lists sub categories in top. You are wanting to show description in there?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Adding Category Description to CategoryGridPage

Post by jmestep » Tue Sep 16, 2014 1:24 am

It looks like it would work with a small c
if (_category != null)
{
.......

if (!string.IsNullOrEmpty(_category.Description))
{
CategoryDescriptionPanel.Visible = true;
CategoryDescription.Text = _category.Description;
}
C# is case sensitive.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply