# How to add%{post\_url} in customize URL

**URL:** https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935
**Category:** Support
**Created:** [January 22, 2021, 12:24pm UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935 "2021-01-22T12:24:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![McFlyPartages](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcflypartages/32/197179_2.png) [@McFlyPartages](https://meta.discourse.org/u/McFlyPartages)
#### Post date: [January 22, 2021, 12:24pm UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/1 "2021-01-22T12:24:10Z")

</div>

hello everyone,

I would like to know if it is possible in a URL to put the post\_url of the message from which it was clicked ?

Basically I would like to click on a url which open a new subject in a category with in the body of the message the url of the current post.

I manage to open a new topic in the right category with this message. [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)

it must surely be with %{post\_url}

I just have to add the URL of the starting post.

Thanks for avance.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [January 22, 2021, 4:46pm UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/2 "2021-01-22T16:46:22Z")

</div>

> [@McFlyPartages](#):
>
> Basically I would like to click on a url which open a new subject in a category with in the body of the message the url of the current post.

It sounds like you are trying to achieve something similar to the Discourse “Reply as linked topic” functionality. Users can do that by selecting that option from the composer’s reply-options menu:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/a/8a49d7ce39985b2b186df2390a54ac7ea530bbe4.png)

You could also achieve that by using the compose topic via URL method that you have linked to. To get that to work, you will need to urlencode the topic’s URL before adding it to the `body` section of the URL. For example, if you wanted to create a link that added this topic’s URL (`https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935`) to the body of a new topic, you would need to urlencode it to `https%3A%2F%2Fmeta.discourse.org%2Ft%2Fhow-to-add-post-url-in-customize-url%2F176935` before adding it to the URL’s `body` section.

If you use that method, you will probably find that you need to URL encode the other parts of the URL to remove any spaces in it’s title. Otherwise it will not create a clickable URL.

---

<div class="post-metadata">

### Author: ![McFlyPartages](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcflypartages/32/197179_2.png) [@McFlyPartages](https://meta.discourse.org/u/McFlyPartages)
#### Post date: [January 22, 2021, 5:11pm UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/3 "2021-01-22T17:11:45Z")

</div>

Oh ok thanks.

It’s not possible with a same link with variable ?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [January 23, 2021, 1:06am UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/4 "2021-01-23T01:06:40Z")

</div>

No, there is not a way to substitute a link into a `post_url` variable. Possibly something that did that could be developed as a theme component or a plugin.

---

<div class="post-metadata">

### Author: ![McFlyPartages](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcflypartages/32/197179_2.png) [@McFlyPartages](https://meta.discourse.org/u/McFlyPartages)
#### Post date: [January 23, 2021, 8:41am UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/5 "2021-01-23T08:41:17Z")

</div>

Very thanks for this information

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 22, 2021, 8:41am UTC](https://meta.discourse.org/t/how-to-add-post-url-in-customize-url/176935/6 "2021-02-22T08:41:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
