Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Sort Some Categories Aphabetically
wadebot
New
Does anyone know how to sort a specific category by Title alphabetically instead of by date?
I've found other discussions where you can sort all discussion categories alphabetically, but I'd like to only apply this sorting to one or two categories. I'd like to use these categories more as a table of contents and not as a discussion category. Thanks ya'll!
0
Answers
I don't think I have seen you around before, hi!
What version number of Vanilla are you running?
You would have to do the filtering on a per category basis then. This sounds like you would need to make a plugin that hooks into the discussion model with something like this:
Then put
$Configuration['Vanilla']['TableOfContents']['CategoryID'] = 3;
in your/conf/config.php
file. Be sure to change 3 to the category ID you want to be alphabetized.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hi! Thanks for the welcome hgtonight!
I'm running the latest version 2.0.18.10 currently.
Making a plugin to do this sounds daunting for my skills, but I'll give it a shot. Thanks for throwing that code together and linking to the plugin creation page. I'll check back with my results.
Well I can't seem to get this to work. This plugin doesn't seem to make a change. Here is what I'm trying to use now:
And here is the line from my config.php when using the discussion name of 'Test'.
$Configuration['Vanilla']['Test']['CategoryID'] = 22;
Making a plugin is easier that I could have expected. Thanks for the direction @hgtonight
Did you comment out the lines noted in that linked discussion?
From: http://vanillaforums.org/discussion/comment/133654/#Comment_133654
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I didn't comment that out originally, but I just commented that out and tested.
It is line 177 and 178 of the \applications\vanilla\models\class.discussionmodel.php that I commented out in the newer version that I'm running. Doing so didn't seem to help with the sorting of a specific category.
Thanks again for the direction!