Page 1 of 1

Category Grid with Basket Options - add description

Posted: Wed Sep 18, 2013 8:07 pm
by Chris Hadden
I use the Category Grid with Basket Options when showing any product. Is there a way to alter the [[ConLib:CategoryGridPage3]] to include the "description" above.... same as shown using "Category Grid with Category Data" ? I suppose I could make an individual scriptlet for each page but seems more complex then it should be..

Thanks

Re: Category Grid with Basket Options - add description

Posted: Thu Sep 19, 2013 5:50 am
by jmestep
You can do that- just take whatever display code is showing the description from the other page and put code from both ascx and cs files into the category grid 3

Re: Category Grid with Basket Options - add description

Posted: Thu Sep 19, 2013 8:38 am
by Chris Hadden
Ok well I opened those files in category grid 4. To try and see if I could find the relevant code.... The problem is I am not a code guy so I am not sure where stuff starts and ends. the cs file contains this which looks like it might be it but not sure what is supposed to be included and what not:

private void BindPage()
{
CategoryBreadCrumbs1.Visible = DisplayBreadCrumbs;
CategoryBreadCrumbs1.CategoryId = this.CategoryId;

//BIND THE DISPLAY ELEMENTS
if (IsValidCategory())
{
if (_Category != null)
{
Page.Title = _Category.Name;
Caption.Text = _Category.Name;

if (!string.IsNullOrEmpty(_Category.Description))
{
CategoryDescriptionPanel.Visible = true;
CategoryDescription.Text = _Category.Description;
}
else CategoryDescriptionPanel.Visible = false;
}
else
{
// IF IT IS ROOT CATEGORY
Page.Title = DefaultCaption;
Caption.Text = DefaultCaption;
CategoryDescriptionPanel.Visible = false;
}
}
else
{
CategoryHeaderPanel.Visible = false;
}
BindSearchResultsPanel();



The ascx seems like this would be it ??




<asp:PlaceHolder ID="CategoryDescriptionPanel" runat="server" EnableViewState="false">
<asp:Literal ID="CategoryDescription" runat="server" Text="" EnableViewState="false" />
<br /><br />
</asp:PlaceHolder>


Can anyone offer guidence on what exactley I place into the category grid 3 to get the description to show?? Thanks

Re: Category Grid with Basket Options - add description

Posted: Fri Sep 20, 2013 4:21 am
by jmestep
You would put this code into the code behind in the BindPage() event

Code: Select all

if (!string.IsNullOrEmpty(_Category.Description))
{
CategoryDescriptionPanel.Visible = true;
CategoryDescription.Text = _Category.Description;
}
else CategoryDescriptionPanel.Visible = false;
Then in the markup (.ascx file) you would put this wherever you want the description to show

Code: Select all

<asp:PlaceHolder ID="CategoryDescriptionPanel" runat="server" EnableViewState="false">            
	        <asp:Literal ID="CategoryDescription" runat="server" Text="" EnableViewState="false" />
	        <br /><br />
        </asp:PlaceHolder>

Re: Category Grid with Basket Options - add description

Posted: Fri Sep 20, 2013 10:28 am
by Chris Hadden
That worked perfectly, thanks for your help on this. Chris