# 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:** 1

<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:** [25 maart 2021 om 12:31 UTC](https://meta.discourse.org/t/modify-new-topic-button-default-behavior/184415/1 "2021-03-25T12:31:31Z")

</div>

Hi everyone,

I’m trying to modify the default behavior of the “New Topic” button in Discourse 2.6.1. I have a custom plugin that modifies the default Ember actions to run my function. It worked properly when using a previous version of Discourse (1.8.0) but I can’t find how to get the same result in the new version. The code is the following one:

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

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

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

```

The first controller controller defined the main site’s actions (which doesn’t work in the new version) and the second one defined the actions to run when running a search in the app (and it works in the new version as well).

I saw that the “New Topic” buttons are created using the “createTopic” and “clickCreateTopicButton” actions but none of them work in the main site. Do I need to modify another action or do we need to use a different controller?

Thanks

---

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