Description on Category Grid Page

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
Ben
Commander (CMDR)
Commander (CMDR)
Posts: 170
Joined: Fri Aug 20, 2004 3:06 pm
Location: Corpus Christi, TX
Contact:

Description on Category Grid Page

Post by Ben » Fri Jun 26, 2009 2:01 pm

What is the best way to get my summary or description on to the Category Grid Page layout? I tried this in the .ascx but didn't work.

Code: Select all

<asp:Literal ID="CategoryDescription" runat="server" EnableViewState="false"></asp:Literal>
The Category Details Page adds my summary/description but doesnt give me a 3 column option. I would be willing to use Category Details Page if I could make it into 3 columns. Thanks

mwolf
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 50
Joined: Mon Jul 02, 2007 9:37 pm
Location: Chicago, IL
Contact:

Re: Description on Category Grid Page

Post by mwolf » Fri Jun 26, 2009 2:07 pm

I actually just did this on CategoryGridPage today.

CategoryGridPage.ascx (add this code wherever you want the description to display)

Code: Select all

<div style="text-align:center; padding:8px;">
  <asp:Literal ID="CategoryDescription" runat="server"></asp:Literal>
</div>  
CategoryGridPage.ascx.cs (change BindPage() function)
Original Code:

Code: Select all

    private void BindPage()
    {
        //BIND THE DISPLAY ELEMENTS
        if (IsValidCategory())
        {
            CategoryBreadCrumbs1.Visible = DisplayBreadCrumbs;
            CategoryBreadCrumbs1.CategoryId = this.CategoryId;
            if (_Category != null)
            {
                Page.Title = _Category.Name;  
                //Caption.Text = _Category.Name;
            }
            else
            {
                // IF IT IS ROOT CATEGORY
                Page.Title = DefaultCaption;
                //Caption.Text = DefaultCaption;
            }
            BindSubCategories();
        }
        else
        {
            CategoryHeaderPanel.Visible = false;
        }
        BindSearchResultsPanel();
    }
CHANGE BindPage() To:

Code: Select all

    private void BindPage()
    {
        //BIND THE DISPLAY ELEMENTS
        if (IsValidCategory())
        {
            CategoryBreadCrumbs1.Visible = DisplayBreadCrumbs;
            CategoryBreadCrumbs1.CategoryId = this.CategoryId;
            if (_Category != null)
            {
                Page.Title = _Category.Name;  
                CategoryDescription.Text = _Category.Description;   
                //Caption.Text = _Category.Name;
            }
            else
            {
                // IF IT IS ROOT CATEGORY
                Page.Title = DefaultCaption;
                //Caption.Text = DefaultCaption;
            }
            BindSubCategories();
        }
        else
        {
            CategoryHeaderPanel.Visible = false;
        }
        BindSearchResultsPanel();
    }

kens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Wed Apr 04, 2007 7:57 am
Location: West Palm Beach, FL
Contact:

Re: Description on Category Grid Page

Post by kens » Tue Dec 14, 2010 12:59 pm

Hi all-

I tried this solution on a customcategorygridpage that I have and it worked fine (I usedd cdesc.text instead of Categorydescription.text). I tried the same code on the regular categorygrid page and it gave me the following error:


cdesc does not exist in the current context

any ideas why it would work in one and not the other?

Thanks

Ken

User avatar
s_ismail
Commander (CMDR)
Commander (CMDR)
Posts: 162
Joined: Mon Nov 09, 2009 12:20 am
Contact:

Re: Description on Category Grid Page

Post by s_ismail » Wed Dec 15, 2010 6:02 am

I guess you are missing literal control with id 'cdesc' in your customcategorygridpage.ascx file. If you want to use literal with id 'cdeskc' then you must have a literal control instead of Categorydescription literal
LIke this one

Code: Select all

<asp:Literal ID="cdesc" runat="server"></asp:Literal> 

kens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Wed Apr 04, 2007 7:57 am
Location: West Palm Beach, FL
Contact:

Re: Description on Category Grid Page

Post by kens » Tue Dec 21, 2010 8:27 am

Almost forgot to come back and say thanks.

It never even occurred to me that I HAD to reference it in ascx page in order to not get an error. I had assumed (rotten me) that step 1 was to set it up in cs file and step 2 was put it in the ascx file and that it wouldn't be a problem.

I have a lot to learn!

Thanks

Ken

Post Reply