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.

Plugin: PostController-Event to replace Category-Drowpdown

edited January 2011 in Vanilla 2.0 - 2.8
Hi

I am trying to create a plugin that replaces the "Category" dropdown menu when starting a new discussion depending on parameters in the URL. I already got to know how to insert my own (hidden) input using a plugin:
class ProjectsPlugin implements Gdn_IPlugin { public function PostController_BeforeFormButtons_Handler($Sender) { echo $Sender->Form->Hidden('test', array('value' => 'test')); } function Setup(){ } }

This of course does not replace the old dropdown input field. I am totally new to plugins, and also reading the Quick-Start Guide didn't help me. ;-)

Has anyone got an Idea how to manage that?

Kind regards.

Comments

  • MarkMark Vanilla Staff
    Hmm. Removing that from the form can be tricky and might require some kludging. The easiest way would be for you to create a new theme instead of a plugin. Then customize that view in your theme to function however you like. Otherwise you're going to have to either (a) hide it with CSS or (b) mess with the configuration array in memory (scary) because it checks to see that categories are in use before writing it (you'd turn that switch off before rendering).
  • This is awesome! I did not expect it to be so easy - Thank you very much.

    What I didn't mention before is that I am also trying to add some custom inputs. Maybe you'll see me again if I don't get it run.

    Thanks again. (:
Sign In or Register to comment.