Page 1 of 1
Re: SimpleCategoryList - category as apramater and display links
Posted: Mon Mar 09, 2009 1:49 pm
by nickc
Hmm. I'm using an older (Fall 2008) version of Able, and my SimpleCategoryList control already does both of those things.
Re: SimpleCategoryList - category as apramater and display links
Posted: Mon Mar 09, 2009 4:17 pm
by jmestep
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.
Re: SimpleCategoryList - category as apramater and display links
Posted: Tue Mar 10, 2009 6:28 am
by jmestep
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>
Re: SimpleCategoryList - category as apramater and display links
Posted: Wed Mar 11, 2009 6:06 am
by jmestep
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.
Re: SimpleCategoryList - category as apramater and display links
Posted: Fri Mar 13, 2009 5:26 am
by mazhar
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.
Re: SimpleCategoryList - category as apramater and display links
Posted: Fri Mar 13, 2009 6:30 am
by jmestep
If you select CategoryDetailsPage as the display page for the category, it will show subcategories, links, webpages and products for that category.
Re: SimpleCategoryList - category as apramater and display links
Posted: Fri Mar 13, 2009 3:42 pm
by jmestep
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);
Re: SimpleCategoryList - category as apramater and display links
Posted: Sat Mar 14, 2009 6:58 am
by jmestep
You could probably put logic into the code to filter out products
if (catalogObject is Category || catalogObject is Webpage..............
or something similar
Re: SimpleCategoryList - category as apramater and display links
Posted: Fri Oct 22, 2010 12:38 pm
by mfreeze
Dynami,
I am interested in doing something similar.
Could you share your categorylist.aspx and categorylist.aspx.cs code?