Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Can I force users to choose a category in Vanilla 2?
whu606
MVP
I've searched for this, and found workarounds which I assume only refer to Vanilla 1.
At the moment, the default category is whichever one I last used (as admin), unless, of course, the user starts a discussion from inside a category.
For forgetful members this results in odd threads appearing in non-relevant categories, and me or another mod doing housekeeping.
As for the Vanilla 1 workaround here: http://vanillaforums.org/discussion/7146
I would like to force my users to choose a category before they can post a discussion.
As always, any help gratefully received.
Thanks.
At the moment, the default category is whichever one I last used (as admin), unless, of course, the user starts a discussion from inside a category.
For forgetful members this results in odd threads appearing in non-relevant categories, and me or another mod doing housekeeping.
As for the Vanilla 1 workaround here: http://vanillaforums.org/discussion/7146
I would like to force my users to choose a category before they can post a discussion.
As always, any help gratefully received.
Thanks.
Tagged:
0
Best Answer
-
Linc AdminIn /views/post/discussion.php (copy it from Vanilla app into your theme if you haven't yet) find this:
echo $this->Form->DropDown('CategoryID', $this->CategoryData, array('TextField' => 'Name', 'ValueField' => 'CategoryID'));
And replace with:echo $this->Form->DropDown('CategoryID', $this->CategoryData, array('IncludeNull' => TRUE, 'TextField' => 'Name', 'ValueField' => 'CategoryID'));
0
Answers
Once again a question answered promptly and perfectly!
My virtual hat off to you all.
Thanks.
{"Code":8,"Exception":"Undefined index: \n\n#0
\/home\/vc\/applications\/vanilla\/controllers\/class.postcontroller.php
(140): Gdn_ErrorHandler()\n#1 \/home\/vc\/library\/core\/class.dispatcher.php
(299): PostController->Discussion(Array, Array)\n#2 \/home\/vc\/index.php
(51): Gdn_Dispatcher->Dispatch()\n#3 {main}"}
using the code Lincoln gave me on my site, if a user doesn't choose a Category then there is 'red box' pop-up at the top of the page 'CategoryID is required'. I haven't found how to change that message, though.
Though I would argue it should be baseline anyway - if categories are in use, it should force you to choose one.