SimpleCategoryList - category as apramater and display links

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
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: SimpleCategoryList - category as apramater and display links

Post by nickc » Mon Mar 09, 2009 1:49 pm

Hmm. I'm using an older (Fall 2008) version of Able, and my SimpleCategoryList control already does both of those things.

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Mon Mar 09, 2009 4:17 pm

If you are talking about the links or webpages not displaying after navigating to the category (in the center content), some of the category grids display them, but others don't.
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

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Tue Mar 10, 2009 6:28 am

Here is the part of the code that changed in the .cs from 10863:

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(CssClass)) MainPanel.CssClass = CssClass;
        if (!string.IsNullOrEmpty(HeaderCssClass)) HeaderPanel.CssClass = HeaderCssClass;
        if (!string.IsNullOrEmpty(HeaderText)) HeaderTextLabel.Text = HeaderText;
        if (!string.IsNullOrEmpty(ContentCssClass)) ContentPanel.CssClass = ContentCssClass;
        if (_CategoryId < 0) _CategoryId = PageHelper.GetCategoryId();
        CategoryList.DataSource = CategoryDataSource.LoadForParent(_CategoryId, true);
        CategoryList.DataBind();
	}
From 11659

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(CssClass)) MainPanel.CssClass = CssClass;
        if (!string.IsNullOrEmpty(HeaderCssClass)) HeaderPanel.CssClass = HeaderCssClass;
        if (!string.IsNullOrEmpty(HeaderText)) HeaderTextLabel.Text = HeaderText;
        if (!string.IsNullOrEmpty(ContentCssClass)) ContentPanel.CssClass = ContentCssClass;
        if (_CategoryId < 0) _CategoryId = PageHelper.GetCategoryId();
        CategoryCollection subCategories = CategoryDataSource.LoadForParent(_CategoryId, true);
        CategoryList.DataSource = subCategories;
        CategoryList.DataBind();
        if(subCategories.Count == 0)
{
            Category category = CategoryDataSource.Load(_CategoryId);

            if (category != null)
            {
                NoSubCategoriesText.Text = String.Format(NoSubCategoriesText.Text, category.Name);
                NoSubCategoriesText.Visible = true;
            }
            
        }
	}
Then 11659 has this added right before the </asp:Panel>

<asp:Localize ID="NoSubCategoriesText" runat="server" Visible="false" EnableViewState="false" Text="There are no sub-categories in <strong>{0}</strong>."></asp:Localize>
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

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Wed Mar 11, 2009 6:06 am

Why do you want to do that? In that case search engines would have two links to the same content and might think you have duplicate content. There have been posts on the forum from people wanting to get rid of that situation.
You might find code in the Admin/Catalog/Browse.aspx to do that-- when you click on a link to edit an item there, it takes you to a non-url rewritten url.
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

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

Re: SimpleCategoryList - category as apramater and display links

Post by mazhar » Fri Mar 13, 2009 5:26 am

In fact the actual page URL is something like
.../Category.aspx?CategoryId=1
The rewriiten verison of this URL is
.../Sample-Category-C1.aspx

So by using either of above URLs you will get same page. That's why Judy said that if you used these different URLs then search engine may get confused and mark page as duplicate contents.

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Fri Mar 13, 2009 6:30 am

If you select CategoryDetailsPage as the display page for the category, it will show subcategories, links, webpages and products for that category.
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

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Fri Mar 13, 2009 3:42 pm

That is because the menus are coded for only categories or subcategories. You would have to customize it to show the other objects. You could possibly replace the
CategoryCollection subCategories = CategoryDataSource.LoadForParent(_CategoryId, true);

with code using CatalogDataSource.LoadForCategory(_CategoryId,true);
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

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

Re: SimpleCategoryList - category as apramater and display links

Post by jmestep » Sat Mar 14, 2009 6:58 am

You could probably put logic into the code to filter out products
if (catalogObject is Category || catalogObject is Webpage..............
or something similar
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

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: SimpleCategoryList - category as apramater and display links

Post by mfreeze » Fri Oct 22, 2010 12:38 pm

Dynami,
I am interested in doing something similar.

Could you share your categorylist.aspx and categorylist.aspx.cs code?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

Post Reply