# \[Solved\] In plugin: opening the composer without changing the route

**URL:** <https://meta.discourse.org/t/solved-in-plugin-opening-the-composer-without-changing-the-route/67710>\
**Category:** Development\
**Created:** [9 Agosto, 2017 12:02 UTC](https://meta.discourse.org/t/solved-in-plugin-opening-the-composer-without-changing-the-route/67710 "2017-08-09T12:02:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)\
**Post date:** [9 Agosto, 2017 12:02 UTC](https://meta.discourse.org/t/solved-in-plugin-opening-the-composer-without-changing-the-route/67710/1 "2017-08-09T12:02:07Z")

</div>

I would like to open the composer from my plugin. But I cannot use the [composing a new pre-filled topic via URL](https://meta.discourse.org/t/compose-a-new-pre-filled-topic-via-url/28074) method, because I don’t want to change the route.

I’ve tried the method explained [here](https://meta.discourse.org/t/client-side-hooks-and-functions/38397/4), but it doesn’t seem to work. I’ve tried to send the `composer:opened` event to other objects (router, application route, application controller, composer controller) but without any success.

I’ve been more successful with the method described [here](https://meta.discourse.org/t/how-to-open-composer-with-prefilled-content/13801), using this kind of code:

```javascript
container.lookup('controller:composer').open({			
	action: Composer.CREATE_TOPIC,
	draftKey: 'new_topic'
})

```

The composer opens correctly, but:

- the preview pane doesn’t seem to work
- I get the following errors in the console:

```plaintext
Uncaught SyntaxError: Unexpected token < markdown-it-bundle.js:1
Error: Could not find module pretty-text/engines/discourse-markdown/helpers discourse/lib/text:40 
    at missingModule (discourse-loader:134)
    at require (discourse-loader:149)
    at setup (pretty-text/engines/discourse-markdown-it:242)
    at buildOptions (pretty-text/pretty-text:100)
    at getOpts (discourse/lib/text:25)
    at cook (discourse/lib/text:30)
    at eval (discourse/lib/text:38)
    at tryCatch (ember:50180)
    at invokeCallback (ember:50195)
    at publish (ember:50163)

```

Any idea?

---

_[View the full topic](https://meta.discourse.org/t/solved-in-plugin-opening-the-composer-without-changing-the-route/67710)._
