# Open Composer with Prefilled information

**URL:** https://meta.discourse.org/t/open-composer-with-prefilled-information/82915
**Category:** Development
**Created:** [13.Март.2018 16:53:47 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915 "2018-03-13T16:53:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![duranmla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/duranmla/32/109295_2.png) [@duranmla](https://meta.discourse.org/u/duranmla)
#### Post date: [13.Март.2018 16:53:47 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915/1 "2018-03-13T16:53:47Z")

</div>

Hello,

I am facing the issue to open the composer with a prefilled information within it, or in case that it is too complex maybe just create a topic from a custom component/widget. **The context of the issue is that I have a custom UI that expect to be used to create a Topic** so there are two scenarios we can use that UI to prefill the composer and finally create the topic of embedded all things needed to create the topic from that custom UI. **Keep in mind that we want also to have the composer as it is.**

I saw I useful idea here: [https://meta.discourse.org/t/accessing-the-createtopic-action-while-on-a-topic-route/26423](https://meta.discourse.org/t/accessing-the-createtopic-action-while-on-a-topic-route/26423) where the author ends up by `reopen` the `ApplicationRoute` and then define his own action, it looks like I can do something like that but not sure where is the right place to write that code; I can define a new custom action to be called on my custom UI button that sends the action of `open` to the _Composer Controller_ with some arguments.

Cheers.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [13.Март.2018 17:18:10 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915/2 "2018-03-13T17:18:10Z")

</div>

Does this help?

> [@Creating a link to start a new topic with pre-filled information](https://meta.discourse.org/t/compose-a-new-pre-filled-topic-via-url/28074):
>
> bookmark This documentation explains how to create a link that starts a new topic in Discourse with pre-filled information. person_raising_hand Required user level: All users Sometimes you may want to provide users with a link that opens a new topic composer with certain information pre-filled. This can be useful for various use cases including bug report templates, feature requests, or standardized posts. Constructing the URL Base URL To compose a new pre-filled topic with no extra i…

---

<div class="post-metadata">

### Author: ![duranmla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/duranmla/32/109295_2.png) [@duranmla](https://meta.discourse.org/u/duranmla)
#### Post date: [13.Март.2018 18:18:21 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915/3 "2018-03-13T18:18:21Z")

</div>

Awesome! Yes, it does! Sorry for not being able to find it by myself. Thanks for taking the time to answer.

**UPDATE:** The only bad thing tho, is that the composer doesn’t open instantly. I have added the following code:

```
_openComposerWithParams($form) {
    var serializedData = $form.serialize();
    var pathToOpenComposer = `/new-topic?${serializedData}`

    // open composer using query params
    DiscourseURL.routeTo(`${pathToOpenComposer}`);
}

```

And even when it works the page jump to `/latest?tags=anonymous` (That tag is been added successfully) but I don’t know why it gets “bind” in the url box.

I will post more about this issue at: [Issue open pre-filled composer](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [14.Март.2018 01:24:47 UTC](https://meta.discourse.org/t/open-composer-with-prefilled-information/82915/4 "2018-03-14T01:24:47Z")

</div>


