# Wijzig het standaardgedrag van de knop "Nieuw onderwerp"

**URL:** <https://meta.discourse.org/t/modify-new-topic-button-default-behavior/184415>\
**Category:** Development\
**Created:** [25 maart 2021 om 12:31 UTC](https://meta.discourse.org/t/modify-new-topic-button-default-behavior/184415 "2021-03-25T12:31:31Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jotamartos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jotamartos/32/214501_2.png) [@jotamartos](https://meta.discourse.org/u/jotamartos)\
**Post date:** [31 maart 2021 om 06:53 UTC](https://meta.discourse.org/t/modify-new-topic-button-default-behavior/184415/6 "2021-03-31T06:53:32Z")

</div>

Thanks for your help @pfaffman. I finally found the controller and the action I needed to modify and the plugin is working again in Discourse 2.6.x

```plaintext
const NavigationDefaultController = require('discourse/components/d-navigation').default;
const SearchResultsDefaultController = require('discourse/controllers/full-page-search').default;
...

function myFunction() {
    CODE HERE
}
...
NavigationDefaultController.reopen({
  actions: {
    clickCreateTopicButton: myFunction,
  },
});

SearchResultsDefaultController.reopen({
  actions: {
    createTopic: myFunction,
  },
});

```

> Note: This is the plugin’s code inside yourPlugin/assets/javascripts/discourse/initializers

Once I click on the “New Topic” button, my javascript code is run and users get the menu I built for the forum.

---

_[View the full topic](https://meta.discourse.org/t/modify-new-topic-button-default-behavior/184415)._
