[Solved] Is it possible to reorder News Categories?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
discosteve
New Member
New Member
Posts: 7
Joined: Fri Mar 20, 2009 5:00 pm

[Solved] Is it possible to reorder News Categories?

Post by discosteve »

I'm running CMS Made Simple Version 1.5.3 with News module 2.9.3.  I have a question about organizing the categories within the News module.  I'm currently using the news module on a website and an editor of the site has created a number of news articles and assigned those articles to specific categories.

They want to have a list of all the categories appear on the website, which is easy enough to do with this tag {news action="browsecat"}.  The problem I'm having is that the list of categories is organized based on when that category was created, but they want the list of categories to appear in alphabetical order.  I went back to look at the News module, thinking that if I reorganized the categories in there they would appear in the right order on the website, but I discovered that there is no way to reorder the categories within the module.  It doesn't seem reasonable to ask them to delete all their categories and add them again in alphabetical order, because they would be messed up again whenever they needed to add a new category.

So, my question is how can I get the list of categories on the website to appear in a different order?  Is it possible to reorder the categories within the News module after they have been created?  It just doesn't make sense for their website to have the categories appear in the order they were created.

Thanks for your help!
Last edited by discosteve on Sat May 30, 2009 3:33 pm, edited 1 time in total.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Is it possible to reorder News Categories?

Post by jmcgin51 »

you should be able to reorder the category IDs in the database.  I don't know of a way to reorder them in the admin panel
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Is it possible to reorder News Categories?

Post by Nullig »

As far as I know, the only way to reorder them the way you want, is to edit the browsecat.php file and change the line:

$query .= ' ORDER by hierarchy';

to:

$query .= ' ORDER by long_name';

Nullig
discosteve
New Member
New Member
Posts: 7
Joined: Fri Mar 20, 2009 5:00 pm

[Solved] Is it possible to reorder News Categories?

Post by discosteve »

Fantastic.  $query .= ' ORDER by long_name'; works great.

Thanks!
Post Reply

Return to “CMSMS Core”