PDA

View Full Version : Sorting the Categories (asp)


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? :)

John (Interspire Staff)
11-02-2004, 12:28 AM
Hi SwizzleSkids,

Unfortunately this would require a fair bit of customisation and I'm afraid I can't do it for you. You'd have to modify the DB, the control panel form, all the code that handles categories, and the panel on the front-end.
I'll put it down as a feature request because it is a good idea.

Let me know if you want the contact details of some developers who can do customisations for you.

SwizzleSkids
11-02-2004, 11:01 PM
Hi SwizzleSkids,

Unfortunately this would require a fair bit of customisation and I'm afraid I can't do it for you. You'd have to modify the DB, the control panel form, all the code that handles categories, and the panel on the front-end.

Wow that sounds like a lot of work. The only other way I thought of customizing the order of categories is to just make them regular html links.

For example - now that I know the url of the categories I created - I could just take out all of the dynamic ASP and place them as static links in the RootArticlesCategoriesPanel.

Do you forsee any problems with this idea?