SwizzleSkids
11-01-2004, 07:55 PM
Hi - can anybody help me in figuring out a way to sort your list of categories? Right now they're done alphabetically by default. I think the easiest way to do it would be on the admin end under "categories." (feature request!)
Until then, how could I customize the code? We have a few categories that will definately be more popular than others, and I'd like to be able to choose the order in which to display them. Here's the RootArticlesCategoriesPanel section that deals with it:
<TD class="Content">
<asp:Repeater id="CategoryMenu" Runat="server" Visible="<%# CurrentCategories.Count > 0 %>" DataSource='<%# CurrentCategories %>'>
<ItemTemplate>
<div class="ListItem">
<A href='<%# LinkHelper.CreateCategoryLink((Category)Container. DataItem) %>'>
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</A>
</div>
</ItemTemplate>
</asp:Repeater><asp:Label Runat="server" ID="NoCategoriesLabel" Visible="<%# CurrentCategories.Count == 0 %>" text='<%# ResourceHelper.GetString("NoCategories") %>'></asp:Label></TD>
So it looks like it's sorting them by "name." Is there a way to assign a "weight" or something to them in order to sort them in a different way? :)
Until then, how could I customize the code? We have a few categories that will definately be more popular than others, and I'd like to be able to choose the order in which to display them. Here's the RootArticlesCategoriesPanel section that deals with it:
<TD class="Content">
<asp:Repeater id="CategoryMenu" Runat="server" Visible="<%# CurrentCategories.Count > 0 %>" DataSource='<%# CurrentCategories %>'>
<ItemTemplate>
<div class="ListItem">
<A href='<%# LinkHelper.CreateCategoryLink((Category)Container. DataItem) %>'>
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</A>
</div>
</ItemTemplate>
</asp:Repeater><asp:Label Runat="server" ID="NoCategoriesLabel" Visible="<%# CurrentCategories.Count == 0 %>" text='<%# ResourceHelper.GetString("NoCategories") %>'></asp:Label></TD>
So it looks like it's sorting them by "name." Is there a way to assign a "weight" or something to them in order to sort them in a different way? :)