Keyword

Order By Name in Categories Model (Instead of by Ordering)

  • Omar Ramos
  • Omar Ramos's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 3 months ago #78261 by Omar Ramos
I was noticing (after adding some 200+ categories) that the dropdown list when creating a new category (or a new item in the frontend) displays categories by ordering instead of by name.This can be a real pain, since the categories may not necessarily be in order when you create them in the administrator, but it would make sense to have them in order within the dropdown for selection.Case in point: I am creating a category for each faculty member (so this is very name specific) and in the frontend that category list is pretty huge, and out of order.Simply by changing one line (line 424 in the categories.php model file in the administrator side of K2):from:$query.=" ORDER BY parent, ordering";to:$query.=" ORDER BY parent, name";Solved that problem for me, and doesn't cause any problem to anybody else I don't think so why not do it :-).

Please Log in or Create an account to join the conversation.

  • Omar Ramos
  • Omar Ramos's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 3 months ago #78262 by Omar Ramos
I just realized this change would also need to be applied to the queries within the category JElement classes in the backend (that way this update will also be there when creating a K2 Category menu item).

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum